Ruby On Rails on CentOS 4.6

Problem
Installing Ruby on Rails on CentOS 4.6.
The yum install ruby installs an old version of Ruby 1.8.1, but you want 1.8.6
Solution
Based on a script from uberdose

The original post is here:
http://wp.uberdose.com/2007/07/15/ruby-on-rails-on-centos-45/