Gem Install Error – no such file to load — zlib

If you are troubled with the below

gem install
ERROR: Loading command: install (LoadError)
no such file to load — zlib
ERROR: While executing gem … (NameError)
uninitialized constant Gem::Commands::InstallCommand

Then you have installed ruby without the nessacary libraries available.

Remove the ruby install (hopefully just rvm remove 1.9.2)
Then install zlib1g-dev libssl-dev libreadline5-dev as detailed at the start of this post on installing ruby on rails on Ubuntu

Now install ruby again and try again!

Hope this helps

Posted on March 28, 2011 at 12:41 pm by Jordan Carter · Permalink
In: Ruby on Rails, Server Config · Tagged with: 

2 Responses

  1. Written by James
    on October 27, 2011 at 11:56 am

    Awesome, that solved my problem.


  2. Written by futurechimp
    on April 23, 2012 at 11:10 am

    Solved my problem too, thanks a lot!

Leave a Reply