This is a quickie, mostly because I want to get some other stuff done and at least partially because there isn't much to say.
I installed Ruby 1.9.1 from source on Ubuntu 9.10 tonight, because I don't really trust the apt-get repositories where Ruby is involved (it's got a bad track record). When running the "gem" command, I got this:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require':
no such file to load -- zlib (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:1
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/commands/update_command.rb:5
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:167:in `load_and_instantiate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:88:in `[]'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:144:in `find_command'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:131:in `process_args'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:102:in `run'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
from /usr/local/bin/gem:21
Obviously, the issue stems from missing "zlib" files. Not-so-obviously, the name of the "zlib" package on Ubuntu is actually called "zlib1g". So, before compiling Ruby, you need to do this from a command line:
sudo apt-get install zlib1g-dev
Then do a configure, make, make install from the Ruby source directory and you're good to go. At least, I was.
0 comments
Please log in if you wish to leave a comment.


