Search code examples
ruby-on-railsapachepassengerbundlercentos7

Passenger could not spawn process for application


I have deployed my webapp on CentOS 7 using bundle --standalone and have configured the app to use the correct gems by using .bundle/config. It works great when I use rails server, but when I set it up to use passenger I get the following error:

[ 2016-02-02 13:27:50.7037 5134/7fb8225b8700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/rails-web: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger.
  Error ID: 7b0eafb9
  Error details saved to: /tmp/passenger-error-YR2EzW.html
  Message from application: An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
<pre>
/usr/share/rubygems/rubygems/path_support.rb:68:in `path=&apos;: undefined method `+&apos; for nil:NilClass (NoMethodError)
    from /usr/share/rubygems/rubygems/path_support.rb:30:in `initialize&apos;
    from /usr/share/rubygems/rubygems.rb:357:in `new&apos;
    from /usr/share/rubygems/rubygems.rb:357:in `paths&apos;
    from /usr/share/rubygems/rubygems.rb:379:in `path&apos;
    from /usr/share/rubygems/rubygems/specification.rb:794:in `dirs&apos;
    from /usr/share/rubygems/rubygems/specification.rb:658:in `each_normal&apos;
    from /usr/share/rubygems/rubygems/specification.rb:669:in `_all&apos;
    from /usr/share/rubygems/rubygems/specification.rb:822:in `each&apos;
    from /usr/share/rubygems/rubygems/specification.rb:864:in `find&apos;
    from /usr/share/rubygems/rubygems/specification.rb:864:in `find_inactive_by_path&apos;
    from /usr/share/rubygems/rubygems.rb:175:in `try_activate&apos;
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:132:in `rescue in require&apos;
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:144:in `require&apos;
    from &lt;internal:abrt_prelude&gt;:2:in `&lt;compiled&gt;&apos;
</pre>

The code around path_support.rb:68 involves setting GEM_PATH. What does this error message mean and how can I fix it. Thanks.


Solution

  • This appears passenger looks in /home/<username>/.gem/ruby as a part of its spawn process. If /home/<username> doesn't exist (like with system users that don't have home directories), you get this error.

    Here is the bug report.