Ruby 1.8.2 on Ubuntu 5.04

Since yesterday there is a new version of Ruby On Rails available: 0.13.1. It seems like this version has introduced a version-check on Ruby which makes it hard to get Rails installed on Ubuntu 5.04. The problem here is, that Hoary uses a pre-release of Ruby 1.8.2 as base which was made 2 days before the final release.

I decided to simply rebuild Breezy’s ruby1.8 (1.8.2-9) for Hoary.

  1. Add Breezy’s repositories to /etc/apt/sources.list

  2. Pin Breezy to priority 1, to apt won’t upgrade the whole system – put this in /etc/apt/preferences:

Package: * Pin: release breezy Pin-Priority: 1

  1. Install the build-essential package.

  2. Go to http://packages.ubuntu.com/breezy/source/ruby1.8 and install Hoary’s versions of all of the packages marked as build-depends (I vaguely remember that when I wanted to go the automagic route of “sudo apt-get build-dep ruby1.8” apt wanted to pull Breezy’s version of the build-depends).

  3. Make a directory and do an “apt-get source ruby1.8” (without a sudo) inside it.

  4. “cd ruby1.8-1.8.2”.

  5. “fakeroot dpkg-buildpackage”.

  6. …wait…

  7. You should have some fresh *.deb packages in the parent directory of ruby1.8-1.8.2. Go there and do a “sudo dpkg -i libruby1.8_1.8.2-9_i386.deb ruby1.8_1.8.2-9_i386.deb”.

Note: This is a minimalistic approach that gives you ruby1.8. If you use other Ruby packages/tools (IRB, RI, etc.) you might backport them as well (some of them are built from the ruby1.8 source package and wait for you already).

Shot on July 16, 2005 at 07:13 +0200

Thank you very much for this solution :-)

zerok on July 16, 2005 at 08:09 +0200

To follow-up: rails 0.12.1-1 in Ubuntu do not differ one bit from rails 0.12.1-1 in Debian testing, so I decided to simply grab rails 0.13.1-1’s .deb from Debian unstable and dpkg -i it.

“dpkg-deb -f rails_0.13.1-1_all.deb” shows the package dependencies; I satisfied some from the plethora of packages that came out of backporting rails1.8, some from Breezy (libredcloth-ruby1.8, the dummy rdoc and ruby) and some simply from Hoary (rake, libdbi-ruby1.8 / libpgsql-ruby1.8).

Note: libmysql-ruby1.8’s changelog shows that Breezy’s 2.4.5-6.1 contains some RC bugfix, but is recompiled against newer dependencies. If Hoary’

Shot on July 16, 2005 at 16:40 +0200

[sorry, Firefox crashed on me]

If Hoary’s libmysql-ruby1.8 2.4.5-6 doesn’t work, one might need to recompile Breezy’s libmysql-ruby1.8 2.4.5-6.1 (the way I recompiled ruby1.8 in the beginning).

Shot on July 16, 2005 at 16:42 +0200

Thanks for the info :) But at least for me the mysql-ruby version that is bundled with hoary works without a problem :)

zerok on July 16, 2005 at 18:39 +0200

Great to hear it. :)

As an aside – I guess I’m going to use RubyGems sooner or later anyway. As I guess it’s not too good to mix and match gems and APT packages, I’ll stay with only Ruby from packages, uninstall the rails package, get the RubyGems sources, checkinstall -D them and get everything else through gems.

From what I read so far, checkinstall -D does the same thing as make install, but tracks the changes to the system and actually turns the source-based RubyGems installation into a .deb package (an “unkosher” one, but it’s still better than “classic” make install).

Any thoughts on this route? :)

Shot on July 20, 2005 at 01:40 +0200

My approach on this is a little bit different. Manually installed stuff gets into /usr/local or /opt here. I'm also currently playing a little bit with sourceinstall:

http://www.gnu.org/software/sourceinstall/

zerok on July 20, 2005 at 02:08 +0200

To tell the truth, I didn’t test it (yet), but my bet would be on checkinstalling RubyGems into /opt.

I’ll look at sourceinstall, thanks for the link! So far they definitely get extra points for using wesnoth as the screenshot example. ;)

Shot on July 20, 2005 at 03:59 +0200

Hi zeroK,

I was wondering wether you are also using rubygem? Because installing ruby with a prefix didn't work for me as soon as I had to sudo ruby stuff or sudo gem install stuff. Because sudo is compiled --with-secure-path on Ubuntu, there is no way to add the path for sudo. I tried adding links in /usr/local/bin, but it seems that messed up other stuff because of the many other ruby packages I had installed with apt (that were living in a different path), so I got other error messages. I finally installed ruby without a prefix, but with checkinstall - less trouble. ;)

Sencer on Aug. 6, 2005 at 23:39 +0200

I'm actually no longer using Ubuntu but when I compiled ruby with the alternative prefix I can't recall any such problem as you've described :S Perhaps I was just lucky or I've messed it up that hard to not make it look like it was working :)

zerok on Aug. 7, 2005 at 01:06 +0200

I have been experimenting with Ruby and came across this problem now when I wanted to get started with Rails. For reference, in case someone else has the same problem, there is an updated Ruby in hoary-backports:

deb http://archive.ubuntu.com/ubuntu hoary-backports main universe

Knut on Sept. 26, 2005 at 02:31 +0200

Comment on this

You can use Markdown here.

Please answer the question in this field. It should help keeping spambots out ;-)