I've noticed at least the following oddities around rubygems on Debian (5.0 lenny in my case):
$ sudo gem update --system ERROR: While executing gem ... (RuntimeError) gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
What's the deal? Why is debian's package different?
RubyGems is a system for managing Ruby software libraries. Ruby code packaged in this manner is called a gem. When you find Ruby software you want to use in a project, gems offer a means of downloading, installing and managing the software. History.
The RubyGems software allows you to easily download, install, and use ruby software packages on your system. The software package is called a “gem” which contains a packaged Ruby application or library. Gems can be used to extend or modify functionality in Ruby applications.
Ruby comes with RubyGems by default since version 1.9, previous Ruby versions require RubyGems to be installed by hand.
Note that what I wrote below has significantly changed recently. The Debian Ruby Team has more or less completely revamped their entire approach, including but not limited to their packaging of RubyGems. I'm not sure about Debian 6, but in the version after that, installing Ruby and the RubyGems package from Debian should be safe, maybe even recommended. And obviously, that is going to trickle down into Ubuntu as well.
[EDIT: The following is outdated as of Debian 7 at the latest.]
Mixing to two different package managers is generally a very bad idea. The Debian-Ruby team tries their best to patch RubyGems in such a way that it becomes a slightly less bad idea.
Also, Debian has a set of rules that are intended to keep the system consistent. RubyGems also has its own set of rules. Those two sets of rules are unfortunately not compatible. So, the Debian-Ruby developers patch RubyGems to respect Debian's rules instead of RubyGems's. Moving gems from /usr/lib/ruby
to /var/lib
is one of those things.
Another problem is that Debian stable is, well, stable. This means that the Debian team guarantees that the behavior of the entire system, all 20000 packages, will never change during a release. But the RubyGems developers don't make their bugfixes available separately, the only way to get a bugfix is to upgrade to a new version, with (potentially) different behavior. Therefore, the Debian-Ruby developers cannot just take the RubyGems sources unmodified, they have to reverse engineer the bugfixes from 1.3.7 and apply them to their version of 1.3.6, to ensure backwards compatibility.
In general, you should avoid mixing package managers. Either use RubyGems for everything (in which case it is best to install RubyGems from source instead of using the Debian package) or use APT for everything, in which case you might be interested in DebGem, a service by the Phusion guys (makers of Ruby Enterprise Edition and Phusion Passenger) which provides Debian and Ubuntu packages for pretty much all Gems.
If you like to manage yourself your ruby environment, I can take a look at RVM. It is a good way to have different environments catching your dev needs, because it's wiser to let the debian packages manage the global ruby env.
The best way to avoid it being different and strange is to install it from source. (Many people recommend doing this in any case.)
For 1.9.2 onwards it's really very easy to install Ruby from source. That gets you Gem and everything else, automatically, and completely integrated. (For example, with the Rails gem installed, you can type 'ri field_for' to learn all about nested forms in Rails.)
With or without RVM, it's now the simplest and most reliable way to get Ruby. My 10c, anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With