简体   繁体   中英

Ruby On Rails - Turbolinks error in Tutorial

I've spent a few hours banging my head against this one.

I'm currently following the ruby on rails tutorial here . I created a Users resource, using

$rails generate scaffold User name:string email:string

and this appears to work just fine, but when I try and access localhost:3000/users after starting the server, I get this error:

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>

The only place I've ever seen turbolinks is in the gemfile, so here is that...

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

If anyone has any tips, or can point me in the right direction, I'd greatly appreciate it. Thanks!

This is a common issue with scaffold pages in windows, Refer this ExecJS::RuntimeError on Windows trying to follow rubytutorial . The issue with js compilation giving errors, you can install execjs or node.js to compile the js as rubyracer is not supported on windows

This was for windows running ruby.

I followed the below link and removing the //= require_tree . from application.js has resolved the issue. Path to reach application.js is projectfolder\\app\\assets\\javascripts\\application.js

ExecJS::RuntimeError on Windows trying to follow rubytutorial

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM