使用 vagrant 按照 Wiki 教程在 Ubuntu 14.04 上使用 Nginx Passenger 部署 Ruby on Rails,出现“Could not find a JavaScript runtime”错误,但是我已经安装了 Nodejs 了,请大家指点一下,搞了一天,这个坑实在是迈不过去了。
vagrant@vagrant-ubuntu-trusty-64:~$ sudo add-apt-repository ppa:chris-lea/node.js
vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get update
vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get install nodejs
vagrant@vagrant-ubuntu-trusty-64:~$ nodejs --version
v0.10.33
/var/log/nginx/error.log
[ 2014-10-30 11:02:35.0093 1091/7f942a2f4700 Pool2/Implementation.cpp:287 ]: Could not spawn process for application /vagrant/housing: An error occured while starting up the preloader.
Error ID: 75e8ef8e
Error details saved to: /tmp/passenger-error-ATMG0r.html
Message from application: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/execjs-2.2.2/lib/execjs/runtimes.rb:51:in `autodetect'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/execjs-2.2.2/lib/execjs.rb:5:in `<module:ExecJS>'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/execjs-2.2.2/lib/execjs.rb:4:in `<top (required)>'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require' /home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/uglifier-2.5.3/lib/uglifier.rb:3:in `<top (required)>'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:76:in `require'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:72:in `each'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:72:in `block in require'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in `each'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:61:in `require'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/bundler-1.7.4/lib/bundler.rb:133:in `require'
/vagrant/housing/config/application.rb:12:in `<top (required)>'
/vagrant/housing/config/environment.rb:2:in `require'
/vagrant/housing/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
/home/vagrant/.rbenv/versions/2.1.4/lib/ruby/gems/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `eval'
/usr/share/passenger/helper-scripts/rack-preloader.rb:112:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
[ 2014-10-30 11:02:35.0122 1091/7f941b7fe700 agents/HelperAgent/RequestHandler.h:2306 ]: [Client 20] Cannot checkout session because a spawning error occurred. The identifier of the error is 75e8ef8e. Please see earlier logs for details about the error.