Installing Ruby 1.9.3 on Debian Squeeze

This is a quick way to install Ruby 1.9.3 on Debian. The default version on Squeeze is 1.9.1, but on depending on what you would like to do, you may need a more recent version.

Download the dsc file:

Download the following archives:

For the package to be built, you'll need some dependancies, which you can install via the backports repository:
echo "deb squeeze-backports main" >> /etc/apt/sources.list
apt-get install -y debhelper=9.20120909~bpo60+1
apt-get install -y cdbs quilt bison libgdbm-dev libncursesw5-dev libncurses5-dev libreadline6-dev tcl-dev tk-dev libffi-dev libyaml-dev

Build the package:
dpkg-source –no-check -x ruby1.9.1_1.9.3.0-1.dsc
dpkg-buildpackage -rfakeroot

The result is a deb file that you can install using:
dpkg -i ruby1.9.3_1.9.3.0-1_all.deb