1

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!

WHill
  • 13
  • 1
  • 3

2 Answers2

0

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

Community
  • 1
  • 1
Bijendra
  • 9,467
  • 8
  • 39
  • 66
  • 1
    This was what I was working with, but I wasn't familiar enough with the way RoR works to handle the issue initially. **The file in option 3 is NOT created inside your application, it is a file inside the execJS folder, which exists where you installed rails.** – WHill Feb 01 '14 at 20:48
0

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

Mendy
  • 147
  • 1
  • 9