Welcome Guest | Login

Passenger (mod rails) and local gems

Are mod_rails apps able to use gems installed in ~/.gems? Or would they have to be manually installed by the system administrator?

2008-09-14 10:38 AM

Hi Dalban,

The ruby gems installed for Passenger will be listed by executing the command

/opt/ruby-enterprise-1.8.6-20080810/bin/gem list

The ruby gems which installed on the folder ~/.gems has normally given a gem path of /usr/local/lib/ruby/gems/1.8 but the ruby used by passenger has a got a different gem path /opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8. Hence you have to export the path using the command
export GEM_PATH=/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/:$GEM_HOME   to take the ruby gems from the folder ~/.gems.

2008-09-14 11:49 AM

Thanks for the response! I searched and could not find it in the forums.

So I just put the following in my ~/.bashrc file?

export GEM_HOME=$HOME/.gems
export GEM_PATH=/opt/ruby-enterprise-1.8.6-20080810/lib/ruby/gems/1.8/:$GEM_HOME





2008-09-14 12:18 PM

Yup that should do the trick. Do let us know if there are any issues..

2008-09-14 04:32 PM

Regards,
Rahul

Hello Guest! In order to post you must be an active client with us, please log in or sign up.