Subhransu Mishra
Subhransu Mishra

Reputation: 3061

gem install not working

I recently installed rubygems 1.3.7. When I try to install rails by typing :gem install rails I get an error like this:

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

Upvotes: 0

Views: 2376

Answers (2)

YamilG
YamilG

Reputation: 11

This might work for you:

rvm remove ruby-x.x.x

then

rvm pkg install zlib

then

rmv install 1.9.X

If the problem persists, verify that you indeed indeed all the requirement libraries, or run:

sudo aptitude install build-essential libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev

Note: you may have to uninstall and reinstall everything again.

Upvotes: 1

Roman
Roman

Reputation: 13058

It looks like your Ruby install is missing the zlib extension. If you installed Ruby from source, make sure that you have the appropriate development headers (in Fedora - zlib-devel, in Ubuntu - libzlib-dev or something like this). You can check if it's installed by running the following command:

ruby -rzlib -e 'puts Zlib::VERSION'

Upvotes: 1

Related Questions