我花了几个小时撞到这个。
我目前正在关注ruby on rails教程here。我使用
创建了一个Users资源$rails generate scaffold User name:string email:string
这似乎工作得很好,但是当我在启动服务器后尝试访问localhost:3000 / users时,我收到此错误:
Showing c:/Sites/Rails_Tutorials/demo_app/app/views/layouts/application.html.erb where line #6 raised:
(in d:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/turbolinks-1.1.1/lib/assets/javascripts/turbolinks.js.coffee)
Extracted source (around line #6):
3. <head>
4. <title>DemoApp</title>
5. <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6. <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7. <%= csrf_meta_tags %>
8. </head>
9.<body>
我见过turbolinks的唯一地方是gemfile,所以这就是......
source 'https://rubygems.org'
ruby '1.9.3'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.2'
group :development do
gem 'sqlite3', '1.3.8'
end
gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
如果有人有任何提示,或者可以指出我正确的方向,我会非常感激。谢谢!
答案 0 :(得分:0)
这是Windows中支架页面的常见问题,请参阅此ExecJS::RuntimeError on Windows trying to follow rubytutorial。 js编译给出错误的问题,你可以安装execjs或node.js来编译js,因为windows不支持rubyracer
答案 1 :(得分:0)
这是用于运行ruby的Windows。
我按照以下链接删除了// = require_tree。来自application.js解决了这个问题。到达application.js的路径是projectfolder \ app \ assets \ javascripts \ application.js
ExecJS::RuntimeError on Windows trying to follow rubytutorial