2013-10-16 84 views
1

我開始在導軌上做一些試驗。今天我試圖啓動rails服務器,但我的Cmd引發此異常:失敗啓動導軌服務器Windows 7 x 64

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/lib/execjs/run 
times.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://gi 
thub.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUn 
available) 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/l 
ib/execjs.rb:5:in `<module:ExecJS>' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/execjs-2.0.2/l 
ib/execjs.rb:4:in `<top (required)>' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/uglifier-2.2.1 
/lib/uglifier.rb:3:in `require' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/uglifier-2.2.1 
/lib/uglifier.rb:3:in `<top (required)>' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/ 
lib/bundler/runtime.rb:72:in `require' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/ 
lib/bundler/runtime.rb:72:in `block (2 levels) in require' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/ 
lib/bundler/runtime.rb:70:in `each' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/ 
lib/bundler/runtime.rb:70:in `block in require' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/ 
lib/bundler/runtime.rb:59:in `each' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/ 
lib/bundler/runtime.rb:59:in `require' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/ 
lib/bundler.rb:132:in `require' 
     from D:/Datos/Dropbox/Desarrollo/AprendiendoRuby/Rails/MiPrimerRailsApp/ 
config/application.rb:7:in `<top (required)>' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 
/lib/rails/commands.rb:76:in `require' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 
/lib/rails/commands.rb:76:in `block in <top (required)>' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 
/lib/rails/commands.rb:73:in `tap' 
     from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0 
/lib/rails/commands.rb:73:in `<top (required)>' 
     from bin/rails:4:in `require' 
     from bin/rails:4:in `<main>' 

我試圖重新安裝rails並運行bundle install。我在GemFile中添加了一行,但我沒有得到解決方案。我究竟做錯了什麼?

回答

0

首先,Could not find a JavaScript runtime. See https://gi thub.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUn available)
第二,甚至沒有嘗試使用Windows的軌道發展,守護您的健康

+0

謝謝antiqe爲我回答,但我也嘗試運行「gem install execjs」,但我得到了相同的結果。 – hardvin

1

安裝execjstherubyracer寶石

添加以下的Gemfile

gem 'execjs' 

gem 'therubyracer' 

然後運行

bundle install 
+0

Vimsha,這個愚蠢的問題的藉口,但是,窗口中的Gemfile在哪裏?我看到所有的寶石都有Gemfiles? – hardvin

+0

它將在您的項目根目錄中。例如,如果您的rails項目是'D:// a',那麼您的Gemfile將位於'D:// a/Gemfile'中 – usha

+0

嗨Vimsha謝謝你的答案。當我嘗試將這些元素添加到我的gem文件時,會得到很多新聞錯誤,那可能是一個糟糕的安裝? – hardvin