how to install a custom version of ruby and gems on bluehost

and fcgi, etc.:


So here’s how I did it.

svn co

then go in there
nice ./configure –enable-shared –prefix=$HOME/local_installs && nice
make && make install # install ruby 1.8.6

downloaded rubygems1-2-0.tar.gz

extract it, then $HOME/local_installs/bin/ruby setup.rb [from within it].

now if you do $HOME/local_installs/bin/gem list it shows you your
gems! Actually I’m not sure what it shows you.
But anyway I use a custom gems directory.

in my ~/.bashrc file:

export PATH=”$PATH:$HOME/packages/bin:$HOME/.gems/bin”
export GEM_HOME=”$HOME/.gems”
export GEM_PATH=”$GEM_HOME:/usr/lib/ruby/gems/1.8″
export GEM_CACHE=”$GEM_HOME/cache”
and in environment.rb in the substruct guy:

require ‘socket’
if Socket.gethostname =~ /
 ENV[‘RAILS_ENV’] ||= ‘production’
 ENV[‘GEM_PATH’] = ‘/home/wilkboar/.gems:/usr/lib/ruby/gems/1.8’
 ENV[‘GEM_HOME’] = ‘/home/wilkboar/.gems’

Anyway so you’d need to set those directives [I think] before you do
the rubygems install.

And after that then running ~/local_installs/bin/gem list should show
either none of the ‘normal’ instaled gems.  But you can add more by
doing gem install, like gem install money or what not.  And it works

To test it I add $HOME/local_installs/bin to my path
export PATH=$HOME/local_installs/bin:$PATH
[this so that script/server will pick up the right ruby install]

And run script/server in one console window, then request things from
a different console window
so in one script/server
in another wget localhost:3000
wget localhost:3000/store # this one is the kicker

One thought on “how to install a custom version of ruby and gems on bluehost”

  1. note: dreamhost uses mod_rails which is much easier to setup (though I’ll admit I’ve never DONE it with them, in general mod_rails is far easier to setup).

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.