views:

821

answers:

1
Using Your Ruby Gem(s)

You will need to add /home/username/ruby/gems to the include path.
You can do this by **adding the following code to your script**:

$:.push("/home/username/ruby/gems")

What script are they referring to? This is vague... Where do I add directories to the ruby include path?

+3  A: 

Got it. Looks like the gem path for a default bluehost install requires some "massaging" to work. :) Following instructions from here resolved the problem for me (relevant parts cut and pasted below as well):

http://www.bluehosttricks.com

A) You will need to have the ability to install gems locally. You can do this by following these directions (via SSH):

1) Add the following lines to your $HOME/.bashrc file (these can be copy and pasted):

export GEM_HOME=$HOME/ruby/gems
export GEM_PATH=$GEM_HOME:/usr/lib/ruby/gems/1.8
export GEM_CACHE=$GEM_HOME/cache
export PATH=$PATH:$HOME/ruby/gems/bin

2) Now modify the applications environment.rb file so that the correct gem path is included. This line should go up at the top before the version of rails is specified:

ENV['GEM_PATH'] = '/path/to/their/home/ruby/gems:/usr/lib/ruby/gems/1.8'

3) Kill off any fastcgi processes that they might have running and the issue should be fixed.

EDIT:

I ended up having to follow ALL the steps in the tutorial I linked above. You have to manually edit the rack fastcgi handler file or else the dispatcher will complain. Apparently this is specific to Rails 2.3.3 (2.3.2 worked fine on BH (allegedly)).

cakeforcerberus
looks like you got it, +1 for the detailed instructions, I deleted my answer to decrease clutter.
Sam Saffron
I followed the tutorial perfectly and mine still is complaining. Do you really type /path/to/their/home/ruby/gems ? If not, what is the path/to/their/home on bluehost?
rpflo
@rpflo: No, you don't actually type that. You put YOUR user's gem path followed by the server gem path. So if run the command "echo ~" and it returns "/home/user1" as output, I would set my gem path to "/home/user1/ruby/gems:/usr/lib/ruby/gems/1.8" - Hope that helps.
cakeforcerberus