First of all, this may seem backwards, but I set these environment variables first. This is because I messed up the first time I tried to install Ruby, so these were left hanging around.
Next I downloaded the Ruby source code:
I unarchived it:
tar -zxvf ruby-1.8.6.tar.gz
I made a symbolic link which will match the paths in the RUBYLIB and PATH environment variables I set up previously. Also, it's just a lot easier to type /opt/ruby instead of /opt/ruby-1.8.6-p287:
ln -s ruby-1.8.6-p287 ruby
Now, we build and install:
I next installed RubyGems. First we download the archive and unpack:
tar -zxvf rubygems-1.3.0.tgz
Then we run the setup:
And that is it!