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
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'
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.
精彩评论