2

I am currently in a web development class and we are using Ruby on Rails.

I am using Ruby v1.9.2 and Rails v3.1.1.

My initial problem started when I tried to execute 'rails server'.

I would get the following error:

C:\Sites\rorProjects\basicRoRProject>rails server   
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/execjs-1.2.13/lib/execjs/runtimes.rb:47:in `autodetect': Could not find a JavaScript runtime.   
See https://github.com/sstephenson/execjs for a list of available runtimes.(ExecJS::RuntimeUnavailable)

I have done some reading and the general consensus is to install the gems 'execjs' and 'therubyracer'. 'execjs' installed just fine, however when I tried to install 'therubyracer' I got the following error:

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer: ERROR: Failed to build gem native extension.
        C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb
*** extconf.rb failed ***  
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  
Check the mkmf.log file for more details.  
You may need configuration options.

I then did some more reading and found a couple of people said to check that they had the gem 'libv8', which was required for 'therubyracer'. I did that and discovered that I didn't have it, so I then went to install that and got the same error that I did for 'therubyracer'.

I'm at a loss to think of anything else to do. Any help would be greatly appreciated.

Thanks guys!

THIS PROBLEM HAS BEEN SOLVED.

So, with the help of one of my classmates who had a similar problem, I installed Node.js using the Windows installer (this gave me a JavaScript run-time environment). I then added it to the path in the local variables.

rkb
  • 3,442
  • 19
  • 25
Craig
  • 71
  • 6
  • This is a duplicate of http://stackoverflow.com/questions/6356450/therubyracer-gem-on-windows - short answer: you can work around it with other options. – Tom Jan 17 '12 at 15:46
  • I looked at that problem and what I got out of it was that 'therubyracer' will not work on Windows. Fine. Took it out, and just had 'execjs' but the original problem about not finding the javascript run-time still persists. I looked around some more and from what I can tell Windows has a built in Javascript interpreter which 'execjs' should use, however, it obviously does not... – Craig Jan 17 '12 at 17:05

1 Answers1

5

So, with the help of one of my classmates who had a similar problem, I installed Node.js using the Windows installer. I then added it to the path in the local variables.

rkb
  • 3,442
  • 19
  • 25
Craig
  • 71
  • 6
  • 3
    Feel free to accept your own answer (glad you found it!), so that this question is "closed". – rkb Jan 18 '12 at 04:48
  • The installer adds automatically to PATH, but you sometimes need to log off/log on or reboot for the changed PATH to become active. – TheConstructor Nov 08 '12 at 18:36