Phusion releases DebGem.com into beta
by Christoph Olszowka on Jan.06, 2009, under rails, ruby
Right after starting this blog, I already have the first topic to post about that implies both things I’m focusing on – Ruby and Ubuntu: As Peter Cooper announced on Ruby Inside, Phusion (of Passenger fame) have released a new service called DebGem. What this thing basically does is let you install all RubyForge and Github gems on Debian / Ubuntu machines via apt-get, which many people (me included) prefer over the duplicate handling which the original gem command requires, while still having access to latest as well as older versions (as opposed to the official repositories, which only hold outdated libs), plus it will install required lib dependencies for native builds, say imagemagick for rmagick. They also have a search set up so you can easily find the exact package name you have to type in when installing.
As Peter states though, there are two “catches”:
- Native gems requiring a build are currently only available for Ubuntu 8.04 LTS (you might also want to check out the info on supported distros over at their starting page)
- The service is only free during beta. Phusions clear explanation to that can be found in the FAQ
Thankfully, I’m still on Ubuntu 8.04 on my laptop, so I was able to try it out. After getting through the config steps (basically just another repository in /etc/apt/sources.list with the catch that you have to raise apt’s cache limit due to the huge amount of packages in the repo – Rubyforge without github already gives about 25000 packages) and doing an apt-get update, I was able to get nice datamapper <tab> auto-complete results:
colszowka@colszowka-laptop:~$ sudo apt-get install libdatamapper
libdatamapper0.1.1-ruby1.8 libdatamapper0.3.2-ruby1.8 libdatamapper-all-ruby1.8 libdatamapper-ruby1.8
libdatamapper0.2.5-ruby1.8 libdatamapper0.9.8-ruby1.8 libdatamapper-ruby
The naming and version availablity scheme is explained in the FAQ as well. I won’t copy and paste all of it, but basically when you install libdatamapper-ruby1.8, it will install all versions listed above.
This is because RubyGems supports parallel version installs. For example, RubyGems allows having both Rails 2.1.2 and 2.2.2 installed at the same time. Applications and libraries can depend on a specific version of a gem.
Dpkg does not have a direct equivalent of this feature. So as a compromise, and in order to ensure that everything works out-of-the-box, we install latest versions of the minor version.
Unfortunately, even when I specified a certain version, say libdatamapper0.9.8-ruby1.8, to be installed, the gem dependencies would not get resolved properly, with DebGem requiring me to install a plethora of versions of the gems datamapper depends upon:
dm-cli-all-ruby1.8 dm-cli-ruby1.8 dm-cli0.9.8-ruby1.8 hoe-all-ruby1.8 hoe-ruby1.8 hoe1.0.5-ruby1.8 hoe1.1.7-ruby1.8 hoe1.2.2-ruby1.8 hoe1.3.0-ruby1.8 hoe1.4.0-ruby1.8 hoe1.5.3-ruby1.8 hoe1.6.0-ruby1.8 hoe1.7.0-ruby1.8 hoe1.8.2-ruby1.8 launchy-all-ruby1.8 launchy-ruby1.8 launchy0.1.2-ruby1.8 launchy0.2.1-ruby1.8 launchy0.3.2-ruby1.8 libaddressable-all-ruby1.8 libaddressable-ruby1.8 libaddressable0.1.2-ruby1.8 libaddressable1.0.4-ruby1.8 libaddressable2.0.1-ruby1.8 libdata-objects-all-ruby1.8 libdata-objects-ruby1.8 libdata-objects0.2.0-ruby1.8 libdata-objects0.9.9-ruby1.8 libdatamapper0.9.8-ruby1.8 libdm-aggregates-all-ruby1.8 libdm-aggregates-ruby1.8 libdm-aggregates0.9.8-ruby1.8 libdm-core-all-ruby1.8 libdm-core-ruby1.8 libdm-core0.9.8-ruby1.8 libdm-is-tree-all-ruby1.8 libdm-is-tree-ruby1.8 libdm-is-tree0.9.8-ruby1.8 libdm-migrations-all-ruby1.8 libdm-migrations-ruby1.8 libdm-migrations0.9.8-ruby1.8 libdm-observer-all-ruby1.8 libdm-observer-ruby1.8 libdm-observer0.9.8-ruby1.8 libdm-serializer-all-ruby1.8 libdm-serializer-ruby1.8 libdm-serializer0.9.8-ruby1.8 libdm-timestamps-all-ruby1.8 libdm-timestamps-ruby1.8 libdm-timestamps0.9.8-ruby1.8 libdm-types-all-ruby1.8 libdm-types-ruby1.8 libdm-types0.9.8-ruby1.8 libdm-validations-all-ruby1.8 libdm-validations-ruby1.8 libdm-validations0.9.8-ruby1.8 libextlib-all-ruby1.8 libextlib-ruby1.8 libextlib0.9.9-ruby1.8 rake-all-ruby1.8 rake-ruby1.8 rake0.8.3-ruby1.8 rspec-all-ruby1.8 rspec-ruby1.8 rspec0.9.4-ruby1.8 rspec1.0.8-ruby1.8 rspec1.1.11-ruby1.8 rubyforge-all-ruby1.8 rubyforge-ruby1.8 rubyforge0.4.5-ruby1.8 rubyforge1.0.1-ruby1.8
The estimated additional disk usage for libdatamapper0.9.8-ruby1.8 from DebGem was noted as 28.1 MB. Quite a bit, but I can only recommend not to try this out with apt-get install rails (which oddly enough does not fall into the libXYZ-ruby1.8 scheme) – 484 MB!
Though installation went well, unfortunately I was unable to access the newly installed gem, even though it should have registered with my current rubygems installation:
All DebGem packages register themselves as Ruby gems, thereby providing full compatibility with Ruby software that expect gems.
colszowka@colszowka-laptop:~$ gem list --local | grep 'datamapper' colszowka@colszowka-laptop:~$ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'dm-core' LoadError: no such file to load -- dm-core
Obviously the reason for this is that I do have a manual Rubygems install, rather than the one from the (way outdated) Ubuntu repositories. Since I did not want to mess up my whole gems install, I decided to not go further and rather check this out in a virtual machine on a fresh install as soon as possible, so until then I can only tell that the installed libraries ended up in /var/lib/gems/1.8/gems/ on my machine, which is the default gem install path for the Ubuntu Rubygems package. Obviously the DebGem repositories supply updates for Rubygems, so it might become unneccessary to have manual installs of Rubygems in order to get latest versions. I will try this the next days and keep you updated.
Until then, I can only say that this project is very promising, but obviously still far from maturity. On the other hand, just think of setting up the whole Rails stack on a vanilla Ubuntu/Debian machine through a custom .deb package containing your projects dependencies (ruby1.8, rubygems1.8, rails, passenger, apache2 and so on). The Brightbox passenger debs and DebGem might get us there in no time!
Update, January 7th: The Phusion guys have updated the datamapper (which after a version update also is libdatamapper0.9.9-ruby1.8) debgem, so now it won’t install all these gems I listed above anymore. I am currently testing the whole thing in a vanilla Ubuntu VM, so stay tuned for a future post on that!







January 6th, 2009 on 23:22
Hi Christoph.
Thank you for your useful criticism. There about 25000 gems and naturally, we haven’t been able to test them all, but we’re continuously working on improving things and solving problems. This is why the service is in public beta right now. We’ll take a look at our Datamapper packages. Please keep the feedback coming!
January 7th, 2009 on 16:19
I just wanted to send you an email in order to help you out with your issues, but I couldn’t find any contact information, so I’ll post here.
We’ve taken a better look at our DataMapper packages and we’ve trimmed the number of packages that are required in order to install DataMapper. For example we’ve now omitted pre-0.9 versions because those versions are apparently experimental and nobody uses them in production.
The disk space usage that’s currently reported by apt-get is incorrect. For example, installing Rails 2.2.2 with all dependencies only requires 19 MB of disk space, but apt-get reports 204 MB. We’re still investigating why this is happening, but for now I can safely say that the 484 MB report that you’re seeing is probably incorrect.
As for datamapper not working in RubyGems: perhaps your locally installed RubyGems version is interfering. DebGem provides its own RubyGems package which indeed installs stuff to /var/lib/gems. But unlike Debian’s version, our version also looks in /usr/lib/ruby/gems. I suspect that you’re experiencing the following:
1. When you type “gem”, the shell invokes /usr/local/bin/gem instead of /usr/bin/gem.
2. The RubyGems installation in /usr/local looks for gems in /usr/local/lib/ruby/gems, a place which is not in our RubyGems search path.
If this is true, and your locally installed RubyGems version is indeed interfering, then you could try to uninstall your locally installed RubyGems. Uninstalling RubyGems is completely safe: it won’t remove it gems.
I hope I’ve been able to help you.
January 7th, 2009 on 20:00
I just want you to know that the disk space reporting problem has been fixed. This problem will be published as soon as possible.
$ sudo apt-get install libdatamapper-ruby
…
Need to get 3855kB of archives.
After unpacking 16.2MB of additional disk space will be used.
January 9th, 2009 on 10:11
[...] Christoph Olszowka on Jan.09, 2009, under Rails, Ruby, Ubuntu Like already announced in my previous first look into the new DebGem service by Phusion. I had a deeper look into the service today, giving it a [...]
January 22nd, 2009 on 00:13
[...] basics of using the DebGem service. If you need an introduction, you might want to check out my earlier postings on the [...]