Ruby on rails ExecJS::欢迎索引中的ProgramError
在安装了Ruby 2.3.3、Rails 5.0.0.1和NodeJS 4.2.6的Ubuntu 16.04上,我生成了一个带有Ruby on rails ExecJS::欢迎索引中的ProgramError,ruby-on-rails,ruby,node.js,Ruby On Rails,Ruby,Node.js,在安装了Ruby 2.3.3、Rails 5.0.0.1和NodeJS 4.2.6的Ubuntu 16.04上,我生成了一个带有bin/Rails生成控制器欢迎索引的玩具控制器。在运行了bin/rails服务器之后,我打开了http://localhost:3000/welcome/index以获取以下错误: ExecJS::ProgramError in Welcome#index Showing /rails-app-path/app/views/layouts/application.h
bin/Rails生成控制器欢迎索引的玩具控制器。在运行了bin/rails服务器之后,我打开了http://localhost:3000/welcome/index
以获取以下错误:
ExecJS::ProgramError in Welcome#index
Showing /rails-app-path/app/views/layouts/application.html.erb where line #7 raised:
ReferenceError: CoffeeScript is not defined
Extracted source (around line #7):
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
欢迎索引中的程序错误
显示/rails-app-path/app/views/layouts/application.html.erb,其中第7行凸起:
ReferenceError:未定义CoffeeScript
提取的源(第7行附近):
回答了这个问题
最近更新的coffe脚本源GEM1.12.1中存在问题。问题是此版本中的源文件为空。已经有一个问题,应该很快解决
现在,您可以将其添加到您的文件中
gem 'coffee-script-source', '= 1.11.1'
然后运行bundle update coffee script source
,直到它被修复。结果是,coffee script source
gem的1.12.1版本已被上传。该版本现已发布,因此上面的hello world应用程序现在可以运行了(一旦我重新处理了我的gems)。ExecJS::ProgramError in Welcome#index error:
这是一个简单的修复方法你只需重命名一个文件,
app/views/layouts/应用程序.html.erb
到
app/views/layouts/默认值.html.erb
然后奇迹发生了:)