Reputation: 505
rbenv
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ gem -v
1.8.23
$ gem install rails
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
$ gem install railties
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
I spent hours looking for answers...
Also installed zlib1g-devel
but still cant install rails..
Upvotes: 2
Views: 1331
Reputation: 4959
It's clearly telling you that you don't have zlib:
cannot load such file -- zlib
You haven't provided any details to what system you are running.
sudo apt-get install zlib1g-dev
or
sudo yum install zlib-devel
for red hat/centos/ubuntu systems. You'll then have to reinstall ruby. You may have some other dependencies and might need libyaml-dev or openssl.
Upvotes: 4