Have you tried doing yum install ruby in CentOS 5.5? If you have the default repositories configured, you will notice that it installs the ancient Ruby 1.8.5. Not ready to move up to Ruby 1.9, but would like to install Ruby 1.8.7 – well here is how to do it!
Install Ruby 1.8.7 on CentOS 5.5 (or other distributions)
yum install -y gcc zlib zlib-devel
tar xvf ruby-1.8.7-p330.tar.gz