1

I'm completely new to Ruby on Rails, and I'm having trouble setting it up on my Windows PC. I have successfully followed the instructions on http://rubyonrails.org/download. However, when I go to run the rails server command I come up with this output:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in `a
utodetect': Could not find a JavaScript runtime. See https://github.com/sstephen
son/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:5:in
 `<module:ExecJS>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/execjs-1.2.9/lib/execjs.rb:4:in
 `<top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_
script.rb:1:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_
script.rb:1:in `<top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-
script.rb:1:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-
script.rb:1:in `<top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-r
ails.rb:1:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/coffee-rails-3.1.1/lib/coffee-r
ails.rb:1:in `<top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runt
ime.rb:68:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runt
ime.rb:68:in `block (2 levels) in require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runt
ime.rb:66:in `each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runt
ime.rb:66:in `block in require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runt
ime.rb:55:in `each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runt
ime.rb:55:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:1
22:in `require'
        from C:/RoR/tickets/config/application.rb:7:in `<top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/comman
ds.rb:52:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/comman
ds.rb:52:in `block in <top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/comman
ds.rb:49:in `tap'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/comman
ds.rb:49:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

When i go to the website https://github.com/sstephenson/execjs I'm still uncertain of how to proceed. Can someone point me in the right direction (remember I'm a newbie)? Thanks!

DGM
  • 26,629
  • 7
  • 58
  • 79
Abundnce10
  • 2,150
  • 3
  • 26
  • 41

3 Answers3

2

I met that problem too The solution for me is just add

C:\Windows\System32

to the PATH

and restart your computer.

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
Yang
  • 825
  • 1
  • 10
  • 13
2

I got it working by installing node.js from http://nodejs.org/ (INSTALL link) and added its install path (includes node.exe) to my windows user ' Path' environment variable. I also added Yang's reply path to above mentioned windows variable.

Triq
  • 31
  • 6
0

This may not be a universally popular answer, but for a new user, I would comment out the lines in the gemfile that are loading sass and coffeescript. Not that they are at all bad - but I think they add unnecessary complication for someone getting to grips with the framework. Alternatively if you are already familiar with these components, then you just need to install a javascript runtime -I use node.js

chrispanda
  • 3,204
  • 1
  • 21
  • 23
  • 1
    Don't break the framework to get it running. Also, Sass and Coffeescript are too big improvements to simply ignore. – Marnen Laibow-Koser Nov 08 '11 at 14:51
  • I did what you suggested--disabled the sass and coffeescript gems--and it works! However, I'll have to figure it out once I want to incorporate JavaScript but I'm still trying to get my head around how RoR works, so this works for now. Thanks! – Abundnce10 Nov 09 '11 at 05:27