3

My server is running Ubuntu Hardy and Ruby 1.8.6 installed using aptitude. I'd like to upgrade to Ruby 1.8.7 but, unfortunately, the Ruby package includes Ruby 1.8.7 starting from Ubuntu Intrepid.

I read a couple of tutorials about how to upgrade to Ruby 1.8.7 and I found at least 3 different way to accomplish this task:

  • backports
  • installation from source
  • installation from source and multiple versions

I'm a bit confused. How do you recommend to upgrade to Ruby 1.8.7 taking into consideration I don't need multiple Ruby versions on the same server? I'd like to cleanly replace the existing Ruby 1.8.6 with Ruby 1.8.7.

Zoredache
  • 130,897
  • 41
  • 276
  • 420
Simone Carletti
  • 1,524
  • 3
  • 15
  • 30

4 Answers4

7

As Jeff made me notice that Ruby 1.8.7 has not been backported yet, the other only solution that comes to my mind is to use the PPA of the team packaging Ruby.

There you can find both Ruby version 1.8.7.22 and version 1.9.0.2, should you prefer.

If you don't know how to configure ubuntu to use a PPA, the instructions are also on the linked page (click on Not using Ubuntu 9.10 (karmic)? under the "Adding this PPA to your system" section.

Hope this helps! :)

mac
  • 500
  • 1
  • 5
  • 15
1

Another option is to use the brightbox packages for rubyee.

Below is quoted from Ben Arblaster's post

If you’re on a Hardy based Brightbox, just create or edit /etc/apt/sources.list.d/brightbox-rubyee.list to contain the rubyee-testing component like so:

deb http://apt.brightbox.net/ hardy rubyee-testing

Finally, update and upgrade libruby1.8:

sudo apt-get update

sudo apt-get install libruby1.8 irb1.8 libopenssl-ruby1.8 libreadline-ruby1.8 rdoc1.8 ruby

russellkt
  • 175
  • 1
  • 7
1

This is the one place where I think APT really sucks. To be honest, I'd suggest taking the lazy way out and just install the debs manually.

cd /tmp
wget http://archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8/libruby1.8_1.8.7.174-2_i386.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8/ruby1.8_1.8.7.174-2_i386.deb
sudo dpkg -i libruby1.8_1.8.7.174-2_i386.deb ruby1.8_1.8.7.174-2_i386.deb
sudo apt-get install ruby

This won't work for just any package, but ruby seems to be pretty clean as far as dependencies go. No promises that you won't run into some obscure issue with other packages you might install from apt though.

Jeff Snider
  • 3,272
  • 18
  • 17
  • One caveat with this method: You will not get automatic updates for ruby after this. If there's a security release, APT will not install it for you. – Jeff Snider Nov 14 '09 at 17:36
  • I'm writing this more than a year after the OP, and trying the wgets above i get a 404 in both cases. Is there an updated url for the ruby 1.8.7 debs? – Max Williams Dec 20 '10 at 09:33
  • Take a look at mac's answer above. The link he provided is still valid. The debs I linked to were for one of the short term ubuntu releases rather than an LTS. Alternatively, you can back up one directory in those links and browse for the debs. http://archive.ubuntu.com/ubuntu/pool/main/r/ruby1.8/ It looks like 1.8.7.302-2 is the latest. – Jeff Snider Dec 20 '10 at 17:23
1

If you want to use the repos, and therefore being able to at least know when an update is available, you might choose to use the backport repository. There is a technique, called pinning that allows you to enable the whole repository but install/upgrade only certain packages. Since the ubuntu wiki does a better job than I could at explaining how to do that, I leave you to read it! :)

If you choose to go with the suggestion made by Jeff Snider, than you might wish to run:

sudo apt-get -f update

The -f stands for --fix-broken and what it does is to attempt fixing broken dependencies of already installed packages.

HTH!

mac
  • 500
  • 1
  • 5
  • 15
  • This would be helpful if ruby were in the backports repository, but it's not. Backports is a managed repository that only contains packages that have been requested and the ubuntu team deems appropriate. weppos would have to request ruby 1.8.7 be added to hardy-backports, then wait for them to add it. – Jeff Snider Nov 15 '09 at 16:56
  • Jeff, you are right, sorry I did not notice it myself. See my other answer to this same question. – mac Nov 15 '09 at 19:01