Ruby – cannot load such file –zlib

rubyrubygemsubuntu

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: https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-from-source

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.

https://rvm.io/packages/zlib/

rvm pkg install zlib

and reinstall all your rubies