4

I want to install ruby. My OS is centos5.5. When I gem install bundle this get something wrong

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

I try yum install zlib, but it prompts

Package zlib-1.2.3-4.el5.i386 already installed and latest version

I have searched this error, but I still can not solve this problem.
I found /usr/local/rvm/src has zlib-1.2.6.
I try into /usr/local/rvm/src/ruby-1.9.2-p318/ext/zlib and compile it ruby extconf.rb But I got this infomations:

checking for deflateReset() in -ltrue... no
checking for deflateReset() in -llibz... no
checking for deflateReset() in -lzlib1... no
checking for deflateReset() in -lzlib... no
checking for deflateReset() in -lzdll... no

So how can I do?
Thanks.

Cloverstd
  • 75
  • 1
  • 6

1 Answers1

4

It seems rvm is unable to find zlib. Try reinstalling ruby by first installing zlib for the rvm.

rvm pkg install zlib
rvm remove 1.9.2 
rvm install 1.9.2
Kumar Akarsh
  • 4,954
  • 2
  • 20
  • 31
  • Try this yum install zlib zlib-devel cd /usr/local/rvm/src/ruby-1.9.2-p318/ext/zlib ruby extconf.rb make sudo make install – Kumar Akarsh Apr 09 '12 at 09:44
  • Thanks, It gets solved. But I also have tried this before, It cannot works. Now It works. I do not konw why. – Cloverstd Apr 09 '12 at 09:45