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:
wget http://deb.bearstech.com/squeeze/ruby-1.9.3/ruby1.9.1_1.9.3.0-1.dsc

Download the following archives:
wget http://deb.bearstech.com/squeeze/ruby-1.9.3/ruby1.9.1_1.9.3.0.orig.tar.gz
wget http://deb.bearstech.com/squeeze/ruby-1.9.3/ruby1.9.1_1.9.3.0-1.debian.tar.gz

For the package to be built, you'll need some dependancies, which you can install via the backports repository:
echo "deb http://backports.debian.org/debian-backports/ 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