linux rails3 项目不行不起来_Ruby_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > Ruby > linux rails3 项目不行不起来

linux rails3 项目不行不起来

 2012/4/10 13:52:12  zyn_zyn  程序员俱乐部  我要评论(0)
  • 摘要:环境:linux操作系统,ruby1.9.3+rails3.2如果出现下面问题:however,whenitrytoactivatetheserverwith'railss'or'railsserver',Istillget:/usr/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in`autodetect':CouldnotfindaJavaScriptruntime.Seehttps://github
  • 标签:Linux rails rails3 项目

环境:linux操作系统, ruby1.9.3+rails3.2

?

如果出现下面问题:

however, when i try to activate the server with 'rails s' or 'rails server' , I still get: /usr/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in `autodetect': Could not fi
nd a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtime
s. (ExecJS::RuntimeUnavailable)
from /usr/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /usr/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs.rb:4:in `<top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (re
quired)>'
from /usr/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (re
quired)>'
from /usr/lib/ruby/gems/1.9.1/gems/coffee-rails-3.2.1/lib/coffee-rails.rb:1:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/coffee-rails-3.2.1/lib/coffee-rails.rb:1:in `<top (requ
ired)>'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 l
evels) in require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in r
equire'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /home/john/rails_space/config/application.rb:7:in `<top (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.0/lib/rails/commands.rb:53:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.0/lib/rails/commands.rb:53:in `block in <t
op (required)>'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.0/lib/rails/commands.rb:50:in `tap'
from /usr/lib/ruby/gems/1.9.1/gems/railties-3.2.0/lib/rails/commands.rb:50:in `<top (requi
red)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

?

?

?

解决办法:

gemfile文件中添加如下两句代码:

gem 'execjs'
gem 'therubyracer'

?

运行:

bundle install

?

发表评论
用户名: 匿名