Windows机器上的Rails和JavaScript运行时出现问题

Cra*_*aig 2 javascript ruby windows gem install

我目前正在使用Web开发类,我们正在使用Ruby on Rails.

我使用的是Ruby v1.9.2和Rails v3.1.1.

当我尝试执行'rails server'时,我的初始问题就出现了.

我会收到以下错误:

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)
Run Code Online (Sandbox Code Playgroud)

我做了一些阅读,普遍的共识是安装宝石'execjs'和'therubyracer'.'execjs'安装得很好,但是当我尝试安装'therubyracer'时,我收到以下错误:

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.
Run Code Online (Sandbox Code Playgroud)

然后我做了一些阅读,发现有几个人说要检查他们是否有'libub8',这是'therubyracer'所必需的.我做到了,发现我没有它,所以我去安装它并得到了我为'therubyracer'所做的相同的错误.

我不知道还有别的事要做.任何帮助将不胜感激.

多谢你们!

这个问题已经解决了.

因此,在我遇到类似问题的同学的帮助下,我使用Windows安装程序安装了Node.js(这给了我一个JavaScript运行时环境).然后我将它添加到局部变量的路径中.

Cra*_*aig 5

因此,在我遇到类似问题的同学的帮助下,我使用Windows安装程序安装了Node.js. 然后我将它添加到局部变量的路径中.

  • 随意接受你自己的答案(很高兴你找到它!),这个问题是"关闭"的. (3认同)