Ruby on Rails and Ruby Gems on Debian Lenny using backports

There’s a thing about Debian… it’s super stable, but the devs always want newer software, so if they need Ruby you have a choice of compiling it from source as I previously described here or better using the Debian Backports.

First follow this to add backports to your list of APT sources then edit your /etc/apt/preferences and add following lines

Package: libopenssl-ruby1.8
Pin: release a=lenny-backports
Pin-Priority: 999

Package: libruby1.8
Pin: release a=lenny-backports
Pin-Priority: 999

Package: ruby
Pin: release a=lenny-backports
Pin-Priority: 999

Package: ruby1.8
Pin: release a=lenny-backports
Pin-Priority: 999

Package: rubygems
Pin: release a=lenny-backports
Pin-Priority: 999

Package: rubygems1.8
Pin: release a=lenny-backports
Pin-Priority: 999

This will make APT to use versions of the above packages from the Backports repository.

user@computer:$ sudo apt-get install ruby1.8 rubygems && sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby

Now you will have much newer versions of Ruby in your system and best of all it will be updated when new backports versions will be released,

You can probably skip the rubygems as it’s old anyway and follow this steps to get it up to date, also irb command is broken and apparently is very useful for devs so let’s fix it:

user@computer:$ apt-get install irb
...
cd /usr/local/src/
wget http://rubyforge.org/frs/download.php/73882/rubygems-1.4.2.tgz
...
tar -zxf rubygems-1.4.2.tgz
...
cd rubygems-1.4.2
...
sudo ruby setup.rb
  • Anonymous

    Now you will have much newer versions of Ruby in your system and best of all it will be updated when new backports versions .

    wholesale gemstones