Installing Ruby / Gems from sources in Debian Lenny

Posted on: January 25, 2010

Installing Ruby / Gems (/ Rails) from the Debian packages is very convenient and nice, but the versions are old. If you want to stay on top of things, naturally you will want to install from source, but many who do run into the error below, when trying to install / update gems after a fresh install.

$ gem update --system
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/spec_fetcher.rb:1:in \
        `require': no such file to load -- zlib (LoadError)

The cause for this and a remedy has been suggested in the following thread (Bug#1090):


Not sure if I agree with the thread that this is a bug because ruby doesn’t complain loud enough about the missing zlibs, but here’s the concise solution anyway:

Essentially, unless you first install the zlib packages ruby will build without them, so this is the first step:

apt-get install zlib1g zlib1g-dev zlibc libzlib-ruby

next, when you ./configure ruby, add the –prefix =/usr/local

$ cd 'your ruby source dir'
$ ./configure --prefix=/usr/local

next make, make test, make install and you should be able to

$ gem update --system

without problems.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


This blog has no clear focus. It has a focus though, it's just not very clear at the moment...

Dev Env.

Visual Studio 2008 Prof / NUnit / Gallio / csUnit / STools (ExactMagic) / doxygen / dxCore / TypeMock / TestDriven.net / SequenceViz / CLRProfiler / Snoop / Reflector / Mole / FxCop / Subversion / TortoiseSVN / SlikSVN / CruiseControl.net / msbuild / nant

Blog Stats

  • 81,636 hits