问题
I changed ruby version to 2.1.5 with RVM, configured 4 rails App with Apache, but I can't start them with Passenger. So I got this error everytime.
App 8612 stderr: Cannot execute "/root/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.8/buildout/support-binaries/PassengerAgent": Permission denied (errno=13)
[ 2015-06-01 20:11:43.2847 8422/7f244835b700 App/Implementation.cpp:287 ]: Could not spawn process for application /var/www/example: An error occured while starting up the preloader.
Error ID: 2862c35c
Error details saved to: /tmp/passenger-error-pKDVAi.html
Message from application: Cannot execute "/root/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.8/buildout/support-binaries/PassengerAgent": Permission denied (errno=13)
[ 2015-06-01 20:11:43.2889 8422/7f2449b9f700 age/Hel/Req/CheckoutSession.cpp:252 ]: [Client 2-1] Cannot checkout session because a spawning error occurred. The identifier of the error is 2862c35c. Please see earlier logs for details about the error.
How should I correct situation? I use chown -R 777 /root/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.8/buildout/support-binaries/
, but problem last
回答1:
First of all, you should not run your application with the root user.
Add PassengerUserSwitching on
to your virtual host. If your web app is owned by root, it should be able to use rvm (as it is installed for root user only).
来源:https://stackoverflow.com/questions/30585392/error-in-starting-rails-passenger-app