其他 本机装 ruby-china 遇到了个问题,麻烦达人来看看

jinleileiking · 2011年11月28日 · 最后由 ywjno 回复于 2012年04月18日 · 5330 次阅读
➜  ruby-china git:(master) ✗ rake assets:precompile --trace
:public is no longer used to avoid overloading Module#public, use :public_folder instead
    from /home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/resque-1.19.0/lib/resque/server.rb:12:in `<class:Server>'
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in `autodetect'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs.rb:5:in `<module:ExecJS>'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs.rb:4:in `<top (required)>'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/coffee-rails-3.1.1/lib/coffee-rails.rb:1:in `<top (required)>'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
/home/jinleileiking/shsf/ruby-china/config/application.rb:12:in `<top (required)>'
/home/jinleileiking/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/jinleileiking/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/jinleileiking/shsf/ruby-china/Rakefile:4:in `<top (required)>'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/home/jinleileiking/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
➜  ruby-china git:(master) ✗ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
➜  ruby-china git:(master) ✗ gem list

*** LOCAL GEMS ***

actionmailer (3.1.1)
actionpack (3.1.1)
activemodel (3.1.1)
activerecord (3.1.1)
activeresource (3.1.1)
activesupport (3.1.1)
addressable (2.2.6)
arel (2.2.1)
aws-ses (0.4.4)
bcrypt-ruby (3.0.1)
bson (1.3.1)
bson_ext (1.3.1)
builder (3.0.0)
bundler (1.0.21 ruby)
capistrano (2.9.0)
carrierwave (0.5.6)
carrierwave-mongoid (0.1.2)
cells (3.6.7)
chinese_pinyin (0.4.1)
chronic (0.6.6)
chunky_png (1.2.5)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.1.3)
daemon-spawn (0.4.2)
dalli (1.1.1)
database_cleaner (0.7.0)
delorean (1.1.1)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.2.9)
factory_girl (2.3.2)
factory_girl_rails (1.4.0)
faraday (0.7.5)
ffaker (1.10.1)
hashie (1.2.0)
highline (1.6.8)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.16)
json (1.6.1)
kgio (2.6.0)
mail (2.3.0)
mime-types (1.17.2)
mini_magick (3.3)
mongo (1.3.1)
mongo-rails-instrumentation (0.2.4)
mongoid (2.2.4)
mongoid_auto_increment_id (0.2.2)
multi_json (1.0.3)
multipart-post (1.1.4)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.2.1)
net-ssh-gateway (1.1.0)
nokogiri (1.5.0)
oauth (0.4.5)
oauth2 (0.5.1)
omniauth (1.0.1)
omniauth-github (1.0.0)
omniauth-oauth (1.0.0)
omniauth-oauth2 (1.0.0)
omniauth-openid (1.0.1)
omniauth-twitter (0.0.7)
orm_adapter (0.0.5)
polyglot (0.3.3)
rack (1.3.5)
rack-cache (1.1)
rack-mount (0.8.3)
rack-openid (1.3.1)
rack-protection (1.1.4)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.1.1)
rails-i18n (0.1.8)
rails_autolink (1.0.4)
railties (3.1.1)
raindrops (0.8.0)
rake (0.9.2.2)
rdiscount (1.6.8)
rdoc (3.11)
redis (2.2.2)
redis-namespace (1.0.3)
redis-objects (0.5.2)
redis-search (0.6.3)
resque (1.19.0)
resque_mailer (2.0.2)
rmmseg-cpp-huacnlee (0.2.8)
rspec (2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
rspec-mocks (2.7.0)
rspec-rails (2.7.0)
ruby-openid (2.1.8)
sass (3.1.10)
sass-rails (3.1.5)
settingslogic (2.0.6)
simplecov (0.5.4)
simplecov-html (0.5.3)
sinatra (1.3.1)
sprite-factory (1.4.1)
sprockets (2.0.3)
subexec (0.1.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.31)
uglifier (1.1.0)
unicorn (4.1.1)
vegas (0.1.8)
warden (1.1.0)
will_paginate (3.0.pre2)
xml-simple (1.1.1)
➜  ruby-china git:(master)

说:Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.

我装了 execjs 也不好使

共收到 11 条回复

装 Node.JS,也可以的

exejs 只是一個介面,你還要安裝 javascript 的 runtime。裝了 node.js 後就沒問題了。

https://github.com/rails/rails/issues/2963 我也觉得这个错误提示不是很友好...

#2 楼 @siuying 具体怎么操作呀

Gemfile 里加上 gem 'therubyracer'

#4 楼 @Desert http://nodejs.org/ 下载你系统对应该的包或者下载源码编译安装

#6 楼 @doitian 典型夜猫子啊,谢谢了,虽然错误提示一大堆,但是还是运行起来了

可以用以下两方法解决

1)在Gemfile文件中添加

gem 'execjs'
gem 'therubyracer'


然后运行bundle install

2)安装node.js

#8 楼 @ywjno 正解 , ps 错误提示比较 2, 应该打印出一些建议的呀

唉。 我已经在 dotfiles 里建了个 Gemfile。 装一些系统预置的 gem 了

#source 'http://ruby.taobao.org' source 'http://www.rubygems.org'

gem "execjs" gem "irbtools" gem "ruby-debug19" gem "ruby-debug-ide19" gem "gemedit" gem "foreman" gem "pry" gem "pry-nav"

#9 楼 @ltl3884 出现 Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes 这个错误貌似是框架报出来的,跟 ruby-china 无关(win 跟 mac 下都有 JavaScript runtime),我昨天在 ubuntu 的 vps 上折腾的时候也遇到这问题了

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