Dreamhost, Rails and locally installed Gems

I followed the instructions for installing Collaboa on Dreamhost, which includes building and installing local versions of everything interesting – Rails, Subversion, FastCGI, Gems.

The environment can be setup in the .bash_profile, .bashrc and .gemrc files to allow all the tools find these locally installed versions. .bashrc is claimed to be the place for non-interactive apps to get their configuration setup. It seems not, at least for the Dreamhost configuration.

After trying all the tricks in the book to get my Rails app running under FastCGI, I eventually worked out what was missing—my app wasn’t picking up the locally installed Gems.

To make this work, I added the following lines to my dispatch.fcgi file:

ENV['RAILS_ENV'] = 'production'
ENV["GEM_HOME"]="/home/<username>/.gems"
ENV["GEM_PATH"]="/usr/lib/ruby/gems/1.8:/home/<username>/.gems"

After killing the existing processes, my app started working as expected. Woot!

I also added Todd’s new Dreamhost Plugin to the app to help improve reliability.

This entry was posted on Sat, 03 Feb 2007 08:39:31 GMT . You can follow any any response to this entry through the Atom feed. You can leave a comment or a trackback from your own site.
Tags


Trackbacks

Use the following link to trackback from your own site:
http://blog.craz8.com/trackbacks?article_id=dreamhost-rails-and-locally-installed-gems&day=03&month=02&year=2007

Comments

Leave a response

  1. Hank about 17 hours later:

    Thanks for the tip. I’ll add it to my FastCGI aresenal. If you get tired of Dreamhost, Site5 has some great hosting plans. You can find them here:

    http://rubyurl.com/gy3

Leave a comment