#download the source
curl -o /tmp/ruby.tar.gz ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz

#uncompress the file
cd /tmp
tar xvzf ruby.tar.gz

#configure, make and make install
cd /tmp/ruby-1.8.5
./configure --prefix=/usr/local/ruby-1.8.5
make
sudo make install

#create a link
cd /usr/local
sudo ln -s ruby-1.8.5 ruby

#cleanup
rm -fr /tmp/ruby*

#remind that the binaries need to be in the path
echo " "
echo " "
echo "#####################################################################"
echo "It would be helpful if you put the ruby binaries in your \$PATH"
echo "environment variable.  In your ~/.bash_profile add the following line"
echo "PATH=/usr/local/ruby/bin:\$PATH" 
echo "#####################################################################"
echo " "
echo " "