I searched around, people say it suppose to work that I don't need javascript runtime on Windows, but it's not working. When I run rails server, it tells me I need runtime and show a link to a github page. Also I tried to install those runtime listed on that github page, including therubyracer, nothing is able to be installed, got errors everywhere. The question is, what should I do to get Rails 3.1 running on Windows 7?
-
http://stackoverflow.com/questions/7820787/windows-7-with-rails-3-1-error and http://cicolink.blogspot.com/2011/06/how-to-install-ruby-on-rails-with.html; how did you install? – Dave Newton Nov 03 '11 at 01:35
-
rails 3 was working for me, to install 3.1, I just gem update rails. Your links don't have the answer, it got nothing to do with javascript runtime. – Andy Nov 03 '11 at 02:36
-
error installing therubyracer error: failed to build gem native extension – Andy Nov 03 '11 at 02:42
4 Answers
Check this answer: therubyracer gem on windows
You should be using execjs
gem instead.
From the execjs page: it should just use the standard Windows javasccript runtime (Jscript).
Set the following environment variable:
export EXECJS_RUNTIME=JScript
or
ENV['EXECJS_RUNTIME'] = 'JScript'.
Hope this helps.
-
I added the variable, but new error, JScript runtime is not available on this system. Downloaded the Script host but can't install, and it's supposed to be on Windows by default, what should I do? – Andy Nov 04 '11 at 04:57
-
Seems like your windows install is corrupt then? Do you get any errors? Maybe repair the system? Maybe installing IE9 or the new IE10 also installs a new JScript? Good luck! – nathanvda Nov 04 '11 at 07:11
I struggled with this for many hours tonight, doing all sorts of stuff with reinstalling ruby, rails, devkit, trying to include therubyracer or libv8... (I'm sure you've come across all of this by now)
I eventually solved it by: Uninstalling Internet Explorer 9.
I'm now back to the default IE8 and it is working fine.
(Windows 7 Ultimate x64, Service Pack 1, running Ruby 1.9.2p290, Rails 3.1.1, Rubygems 1.8.1.1. Also installed the Devkit and node.js at some stage through this)

- 1,207
- 1
- 15
- 23
You need to install node.js to run the coffeescript compilation used in rails. http://nodejs.org/

- 5,496
- 37
- 56
Have you thought of using vagrant, that way you can have more than one vm you can control and vm for development and their systems are separate from each other so you have less dependency issues.
And also you'll be running linux so everything should be available for that platform.

- 6,541
- 11
- 49
- 84