In my quest to get ruby on rails up and running on all three OSes tat live in my house (windows, mac OSX leopard, linux), I ran into a snag in the install process on Ubuntu 10.04.
Ruby v 1.8.7 was alive and well, however, following the steps at rubyonrails.org, when I tried to update gem:
sudo gem install rails
OR
sudo gem update –system
I received this error:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’:
no such file to load — zlib (LoadError)
Oddly enough, I received the same error when trying to create a rails app or start the rails server – even though rails *seemed* to be installed. Mysterious!
I had previously installed ruby via the synaptic package manager, gotten the same message, then tried again via sudo apt-get install ruby-full build-essential, none of which had relieved the issue.
So, searching the googlenet, I came across this post:
http://thoughtsincomputation.com/posts/ubuntu-and-ruby-191-zlib-missing
He had run into the same issue, and noted that the actual missing library was called zlib1g. I checked synaptic, and I had that installed – but, he noted that he had compiled Ruby from source, which I hadn’t tried. So, following his instructions:
sudo apt-get install zlib1g-dev
I then went to http://www.ruby-lang.org/en/downloads/ and got the source for version 1.9.2 (since this was the version I’m currently running on windows). I compiled ruby1.9.2 from source, and the problem was resolved.
Read More


















