I found the default ruby install that came with Ubuntu to be a bit wonky, so I decided to reinstall it. And I like to use the newest version, always.
First off, get rid of the existing install.
sudo apt-get remove ruby irb ri
sudo apt-get autoremove
Then make sure you have the build-essential package.
sudo apt-get install build-essential
Now, download the source and extract it somewhere. Navigate to it in your prompt and run these:
./configure
make
sudo make install
(Compiling parse.c make take several minutes.)
Now, it should be working. Try this to see if it works-
$ ruby -v
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]