First let's see which is latest relase of ruby.
Download Ruby from the offical ftp server where [version]
has to replaced with the latest release.
cd /usr/local/src
sudo wget http://ftp.ruby-lang.org/pub/ruby/ruby-[version].tar.gz
Untar the downloaded package.
sudo tar -xzvf ruby-[version].tar.gz