上运行时,窗口没有JavaScript运行轨道服务器

上运行时,窗口没有JavaScript运行轨道服务器

问题描述:

我完全新的Ruby on Rails的,和我有麻烦设置它我的Windows PC上。我已成功按照http://rubyonrails.org/download的说明操作。然而,当我去运行rails server命令我想出这个输出:上运行时,窗口没有JavaScript运行轨道服务器

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>' 

当我去的网站https://github.com/sstephenson/execjs我仍然不确定如何进行。 有人可以指出我正确的方向(记得我是一个新手)?谢谢!

这可能不是一个普遍流行的答案,但对于一个新用户,我会注释掉的Gemfile正在加载的青菜和CoffeeScript的线条。并不是说他们一点都不好 - 但我认为他们为了解框架而增加了不必要的复杂性。另外,如果你已经熟悉了这些组件,那么你只需要安装-I使用node.js

+1

不要打破框架,让它运行。另外,Sass和Coffeescript的改进太大,简单地忽略。 –

+0

我做你的建议 - 禁用青菜和CoffeeScript的宝石 - 和它的作品!不过,我得弄清楚,一旦我想结合JavaScript,但我仍然在试图让我周围的回报率是如何工作的头,所以这个工程现在。谢谢! – Abundnce10

我遇到了这个问题太 一个JavaScript运行时对我来说,解决方案只是增加

C:\Windows\System32 

PATH

并重新启动计算机。

我把它通过安装的node.js从http://nodejs.org/(安装链接) 工作,并加入其安装路径(包括node.exe)到我的Windows用户 路径“环境变量。我还将杨的回复路径添加到了上面提到的windows变量中。