Saturday, July 15, 2006

Beware the intersection of packaging systems

I used to use Dave Thomas's rublog. I edited the blogs in vi, dropped the files onto my home directory and it just worked. Then my hosting provider destroyed my site, and I switched to using typo. Which worked fine for a few months and as long as I didn't use it. Let me explain:

I was using FreeBSD and it's ports system to keep the system up to date:

bash-2.05b$ pkg_info|grep -i ruby
ruby-1.8.4_8,1 An object-oriented interpreted scripting language
[snip]
rubygem-rails-1.1.2 MVC web application framework
rubygem-rake-0.7.1 Ruby Make
rubygem-redcloth-3.0.3_1 A module for using Textile in Ruby


So that seemed ok. Even though Ruby has a packaging system of it's own, I assumed that the ports system would be good enough. I'd rather have one packaging system to keep my system up to date, so I never ran a rubygem update. All the gems that I needed were in the ports system so I just used portmanager to stay up to date. It didn't help:

Rendering admin/pages/list within layouts/administration
Rendering admin/pages/list


NoMethodError (undefined method `controller_name' for nil:NilClass):
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/caching.rb:541:in `callback'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/caching.rb:534:in `after'

So when I started setting up my reloaded blog, typo worked. I guess I upgraded some of the ruby components as well:

-bash-2.05b$ pkg_info | grep -i ruby
ruby-1.8.4_8,1 An object-oriented interpreted scripting language
ruby18-fcgi-0.8.6 FastCGI library for Ruby
ruby18-gems-0.8.11 Package management framework for the Ruby language
ruby18-mysql-2.7.1 Ruby module for accessing MySQL databases with a C API like
rubygem-actionmailer-1.2.1 Easy email delivery and testing for Ruby
rubygem-actionpack-1.12.1 Action Controller and Action View of Rails MVC Framework

Here's what I think the issue is: Ruby components are distributed using Gems. The FreeBSD ports system has to encapsulate the gems to get the dependencies:

-bash-2.05b$ find /usr/ports -type d | grep rubygem
/usr/ports/audio/rubygem-mp3info
/usr/ports/databases/rubygem-activerecord
/usr/ports/databases/rubygem-memcache-client
/usr/ports/devel/rubygem-needle
/usr/ports/devel/rubygem-rscm

It's probably time to give up on using Ruby from the ports system. I'm also considering giving up using FreeBSD (because of the Java support), and my hosting provider isn't looking so good either.

This problem won't go away in a hurry. Try installing Eclipse on a Debian system and then adding a plugin as a non-priveledged user. It'll barf because your user process will try and install plugins under /usr. That could be the reason that the Debian eclipse package rotted for so long - why bother fixing the package when you have to install the plugins by hand?

No comments: