cannot load such file — zlib

Problemo

You are trying to install a gem with rvm but you are getting the following error:

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

Solution

Following from the post here

you would need to install the zlib library with rvm, uninstall your ruby version and then install the ruby version again with the folowing:

 

rvm pkg install zlib

rvm uninstall 1.9.3

rvm install 1.9.3