Ruby – cannot load such file –zlib


Ruby & Rails beginner here! Attempting to code out of my iPad 3rd gen using iSSH, Digital Ocean Server (using Ubuntu 12.10), DropBox, and Textastic editor. (There is always somebody trying to ice skate uphill!)

In my installation of Ruby I am following these directions:

When I do step 3: sudo gem update –system

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

I've seen some posts that talk about RVM. Do I need to uninstall everything and start over with RVM? If so do I just delete the directory or is there an uninstall command for Ruby? Do I need to uninstall the libraries? How?

Any and all help is greatly appreciated.

Best Solution

try installing zlib package if you are using RVM.

rvm pkg install zlib

and reinstall all your rubies