Install Ruby 1.8.5 on Debian Sarge (3.1) | October 14, 2006-->
October 14, 2006Unfortunately there is no easy way to install Ruby 1.8.(4|5) on Debian Sarge (stable). Here is how to install Ruby 1.8.5 on Debian Sarge stable:
Add deb-src http://ftp.debian.org/debian/ unstable main to /etc/apt/sources.list
Run apt-get update.
apt-get source ruby1.8 apt-get build-dep ruby1.8 apt-get install devscripts cd ruby1.8-1.8.5 debuild -us -uc cd .. # Rake apt-get source rake apt-get build-dep cd rake-0.7.1 debuild -us -uc cd .. # I had to remove ruby1.8-elisp_1.8.5-2_all.deb. Might work for you rm ruby1.8-elisp_1.8.5-2_all.deb # install the packages dpkg --install *.deb
Check if ruby, ri, irb and rdocs are in /usr/bin.
debian31m:~# which ruby /usr/bin/ruby [...]
Create symlinks if all or one of the above commands is missing:
ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby ln -s /usr/bin/ri1.8 /usr/local/bin/ri ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc ln -s /usr/bin/irb1.8 /usr/local/bin/irbInstall RubyGems the following way:
curl -O http://rubyforge.iasi.roedu.net/files/rubygems/rubygems-0.9.0.tgz tar xzvf rubygems-0.9.0.tgz cd rubygems-0.9.0 /usr/local/bin/ruby setup.rb

Steve Mallett says:
apt-get build-dep
should be “apt-get build-dep rake”
Stephan Zehrer says: http://www.stephan-zehrer.de/RubyOnDebian
apt-get source ruby1.8
requires the package “dpkg-dev”
Henning Schild says:
To follow the debian way it would be a good idea to link the bins through /etc/alternatives/.
> ln -s /usr/bin/ruby1.8 /etc/alternatives/ruby
> ln -s /etc/alternatives/ruby /usr/bin/ruby
and so on
Tim says:
I followed these directions, but when I try to build certain gems it acts like I don’t have ruby1.8-dev:
ruby extconf.rb install hpricot
can’t find header files for ruby.
I do have it:
ii ruby1.8-dev 1.8.5-4 Header files for compiling extension modules
and ruby.h is here:
/usr/lib/ruby/1.8/i486-linux/ruby.h
Any ideas?