To install ruby, I downloaded the version of ruby i needed from http://ftp.ruby-lang.org/pub/ruby/1.8/. And then do the following:
Obviously, you should have read/write privileges to the directory /path/to/dir. Most of the time, it will probably be your home directory.
After much searching and tweaking later on, I also found that you have to set the RUBYLIB environment variable.
Assuming you're using Linux and bash, you do the following:
What if you have a different installation of ruby, say the standard one on the same machine? Good question. I don't know the answer. :) If you do, please leave it in the comments.