2013-10-16 88 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