Issue with Phusion Passenger handling multiple projects with multiple RVM rubies Issue with Phusion Passenger handling multiple projects with multiple RVM rubies apache apache

Issue with Phusion Passenger handling multiple projects with multiple RVM rubies


Do you have a .ruby-version in your project directory? Your project is trying to load ruby-2.0.0-p451 instead of ruby-1.8.7-p374

Have a .ruby-version in your project dir with the set version you want, ie, ruby-1.8.7-p374 and try.

Use rvmrc or ruby-version file to set a project gemset with RVM?


Go to the project directory and run the below commands one by one:

rvm use ruby-1.8.7-p374gem install bundler passengerrvm passenger-install-apache2-module

This will install passenger along with Apache module, mean while you will be asked to add some configuration changes to /etc/apache2/apache2.conf and do it as such.

Create a file in /etc/apache2/sites-available/ for your site (something like 'www.virtualx.com') and insert this:

<VirtualHost *>    # Change these 3 lines to suit your project    RailsEnv production    ServerName www.virtualx.com    DocumentRoot /var/www/my_project/public # Note the 'public' directory</VirtualHost> 

and set the PassengerRuby option to ruby-1.8.7-p374.

Restart Apache service. You are all done.

Now it will work ok.

If you need multiple ruby versions working simultaneously for different projects, then refer here.

Hope it helps :)


I see two issues here:

  1. Phusion Passenger is trying to use /usr/local/rvm/gems/ruby-2.0.0-p451 as the Ruby interpreter to run your app. But /usr/local/rvm/gems/ruby-2.0.0-p451 is a directory, not an executable! Furthermore, you intend to run your app under ruby-1.8.7-p374, not ruby-2.0.0-p451. This means you didn't set your PassengerRuby option correctly. Read http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerRuby to learn how to set this correctly. There's even a section in the manual specifically about how to do this when you're using RVM.
  2. As you can see under "User and groups", Phusion Passenger is trying to execute your app as the "nobody" user. This is probably not what you intended! Use PassengerUser to change the user that your app is executed as.

On a side note, you should upgrade to the latest version of Phusion Passenger, 4.0.41, for the latest bug fixes.