Installing Sandboxed Ruby Environment

I wanted to be able to muck around with Ruby versions and different gems without impacting the system installed ruby environment. This is how to do it


tar -zxf ruby-1.8.6-p111.tar.gz
cd ruby-1.8.6-p111
./configure --prefix=/home/norr/ruby18
make install

export PATH=/home/norr/ruby18/bin:$PATH
export RUBYLIB=/home/norr/ruby18/lib

tar -zxf rubygems-1.0.1.tgz
cd rubygems-1.0.1
ruby setup.rb

To make all this seamless and effortless you could setup a quick script to switch the environment variables around :)