title: Ruby on rails application cannot find a JavaScript runtime in production environment(deploy with passenger and nginx)?
body: <p>I deployed a <code>ruby on rails</code> application in ubuntu with <code>passenger</code> and <code>nginx</code>, but it returned a 500 error.</p>
  
  <p>I read the log, It is because <code>Could not find a JavaScript runtime.</code>, but I have installed <code>node.js</code> in my server(and it runs node ok).</p>
  
  <p>Here is the error log:</p>
  
  <pre><code>Could not spawn process for application /home/roger/ruby_workspace/blog: An error occured while starting up the preloader.
    Error ID: f57c8900
    Error details saved to: /tmp/passenger-error-tIcmuB.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/roger/ruby_workspace/blog/vendor/bundle/ruby/2.2.0/gems/execjs-2.2.2/lib/execjs/runtimes.rb:51:in `autodetect'
    /home/roger/ruby_workspace/blog/vendor/bundle/ruby/2.2.0/gems/execjs-2.2.2/lib/execjs.rb:5:in `&lt;module:ExecJS&gt;'
    /home/roger/ruby_workspace/blog/vendor/bundle/ruby/2.2.0/gems/execjs-2.2.2/lib/execjs.rb:4:in `&lt;top (required)&gt;'
    /home/roger/ruby_workspace/blog/vendor/bundle/ruby/2.2.0/gems/uglifier-2.7.0/lib/uglifier.rb:3:in `require'
    /home/roger/ruby_workspace/blog/vendor/bundle/ruby/2.2.0/gems/uglifier-2.7.0/lib/uglifier.rb:3:in `&lt;top (required)&gt;'
    /home/roger/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.7.11/lib/bundler/runtime.rb:76:in `require'
    /home/roger/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.7.11/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    /home/roger/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.7.11/lib/bundler/runtime.rb:72:in `each'
    /home/roger/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.7.11/lib/bundler/runtime.rb:72:in `block in require'
    /home/roger/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.7.11/lib/bundler/runtime.rb:61:in `each'
    /home/roger/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.7.11/lib/bundler/runtime.rb:61:in `require'
    /home/roger/.rvm/gems/ruby-2.2.0@global/gems/bundler-1.7.11/lib/bundler.rb:134:in `require'
    /home/roger/ruby_workspace/blog/config/application.rb:7:in `&lt;top (required)&gt;'
    /home/roger/ruby_workspace/blog/config/environment.rb:2:in `require'
    /home/roger/ruby_workspace/blog/config/environment.rb:2:in `&lt;top (required)&gt;'
    config.ru:3:in `require'
    config.ru:3:in `block in &lt;main&gt;'
    /home/roger/ruby_workspace/blog/vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'
    /home/roger/ruby_workspace/blog/vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'
    config.ru:1:in `new'
    config.ru:1:in `&lt;main&gt;'
    /opt/passenger/passenger-4.0.57/helper-scripts/rack-preloader.rb:112:in `eval'
    /opt/passenger/passenger-4.0.57/helper-scripts/rack-preloader.rb:112:in `preload_app'
    /opt/passenger/passenger-4.0.57/helper-scripts/rack-preloader.rb:158:in `&lt;module:App&gt;'
    /opt/passenger/passenger-4.0.57/helper-scripts/rack-preloader.rb:29:in `&lt;module:PhusionPassenger&gt;'
    /opt/passenger/passenger-4.0.57/helper-scripts/rack-preloader.rb:28:in `&lt;main&gt;'
  </code></pre>
  
  <p>And the enviroment.rb:</p>
  
  <pre><code># Load the Rails application.
  require File.expand_path('../application', __FILE__)
  
  # Initialize the Rails application.
  Rails.application.initialize!
  </code></pre>