小编Cra*_*aig的帖子

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

我目前正在使用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 …
Run Code Online (Sandbox Code Playgroud)

javascript ruby windows gem install

2
推荐指数
1
解决办法
1172
查看次数

标签 统计

gem ×1

install ×1

javascript ×1

ruby ×1

windows ×1