In the case of Ruby, there is a specific Ruby Version Manager, which maks the life of the coders much easier.
Here are some easy commands:
1. List all the packages installable:
rvm list known
2. Install a specific ruby version
rvm install rubyName
For example, to install the laste version of Ruby
rvm install ruby-head
3. List all the installed rubies
4. Uninstall a specific ruby
rvm uninstall ruby-head
5. Make some clean-up operations
Beside the official ruby, it is useful also for install other version of Rubies, such as jRuby or ironRuby.
For more information, visit the official web page of RVM;