Passenger and locally installed Rails gems

It’s not uncommon that you need to install multiple Rails applications on the same host. They all might use different versions of Rails, and you need to install all of them in order to keep your applications running. One of solutions is to install multiple Rails gem versions globally in the system. However, if you don’t have root access to the server, you are forced to install gems in your ~/.gems directory. This works perfectly well with mongrel, but it fails with Passenger.

Passenger can’t find Rails installed locally in user’s home directory. The only workaround I have found is to freeze rails gems.

Say you have Rails installed in: /home/hubert/.gems and your application sits in: /home/hubert/app

All you need to do is:

$ cd /home/hubert/app
$ rake rails:freeze:gems
$ touch tmp/restart.txt

Voila!

Posted by Hubert Łępicki Mon, 23 Mar 2009 20:26:00 GMT


Comments

Leave a response

Leave a comment