1

我完全新的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我仍然不確定如何進行。 有人可以指出我正確的方向(記得我是一個新手)?謝謝!

回答

0

這可能不是一個普遍流行的答案,但對於一個新用戶,我會註釋掉的Gemfile正在加載的青菜和CoffeeScript的線條。並不是說他們一點都不好 - 但我認爲他們爲了解框架而增加了不必要的複雜性。另外,如果你已經熟悉了這些組件,那麼你只需要安裝-I使用node.js

+1

不要打破框架,讓它運行。另外,Sass和Coffeescript的改進太大,簡單地忽略。 –

+0

我做你的建議 - 禁用青菜和CoffeeScript的寶石 - 和它的作品!不過,我得弄清楚,一旦我想結合JavaScript,但我仍然在試圖讓我周圍的回報率是如何工作的頭,所以這個工程現在。謝謝! – Abundnce10

2

我遇到了這個問題太 一個JavaScript運行時對我來說,解決方案只是增加

C:\Windows\System32 

PATH

並重新啓動計算機。

2

我把它通過安裝的node.js從http://nodejs.org/(安裝鏈接) 工作,並加入其安裝路徑(包括node.exe)到我的Windows用戶 路徑「環境變量。我還將楊的回覆路徑添加到了上面提到的windows變量中。