Ruby rails server Error: Could not find a JavaScript runtime.

scmroad · 发布于 2011年10月11日 · 41 次阅读
96

cm@build08:~/project/demo$ rails server /usr/lib/ruby/gems/1.8/gems/execjs-1.2.9/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) from /usr/lib/ruby/gems/1.8/gems/execjs-1.2.9/lib/execjs.rb:5 from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:inrequire' from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee_script.rb:1 from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in require' from /usr/lib/ruby/gems/1.8/gems/coffee-script-2.2.0/lib/coffee-script.rb:1 from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1:inrequire' from /usr/lib/ruby/gems/1.8/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in require' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:inrequire' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in each' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:inrequire' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in each' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:inrequire' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in require' from /home/cmbuild/project/demo/config/application.rb:7 from /usr/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/commands.rb:52:inrequire' from /usr/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/commands.rb:52 from /usr/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/commands.rb:49:in tap' from /usr/lib/ruby/gems/1.8/gems/railties-3.1.1/lib/rails/commands.rb:49 from script/rails:6:inrequire' from script/rails:6 cm@build08:~/project/demo$ C

共收到 1 条回复
96
scmroad · #1 · 2011年10月11日

In your Gemfile

write this [code] gem 'execjs' gem 'therubyracer' [/code] and then run

[code] bundle install [/code] everything works fine for me :)

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册