There are quite a few packages you need to install and the easiest way to do that is to use Synaptic package manager, but if you prefer you can use apt-get or anything else you fancy. Before you continue make sure that you have enabled Universe repository (how to add repositories), otherwise some of the packages might not show up.
You need to install following packages as well as all dependencies for them (Synaptic will let you know if some package needs additional packages):
* ruby1.8 - installs Ruby 1.8.4
* libmysql-ruby - additional libraries to access MySQL
* libopenssl-ruby - adds SSL capability to Ruby
* libruby1.8-dbg - debugging library
* ri - Ruby Interactive Reference
* ruby1.8-dev - header files for building extensions
* rails - Ruby On Rails framework