Ubuntu rails install fails on zlib Ubuntu rails install fails on zlib ruby-on-rails ruby-on-rails

Ubuntu rails install fails on zlib


If you come across this question trying to install Ruby using Ruby Version Manager (RVM) on Ubuntu 10.04 then there are instructions on installing zlib on the rvm web site http://rvm.beginrescueend.com/packages/zlib/

The steps are:

rvm pkg install zlib

(or rvm package install zlib if you get "ERROR: Unrecognized command line argument: 'pkg'" - older versions of rvm used the verb 'package' instead)

then

rvm remove 1.9.1rvm install 1.9.1


I am using Ubuntu 10.04 (Lucid), i wanted to install ruby 1.9.2 because 1.9.1 is not recommended with Rails. So I downloaded the source for 1.9.2 and unzipped/unarchived it. my source distro is ruby-1.9.2-p0. After I unpacked it, I built zlib as follows:

cd ruby-1.9.2-p0/ext/zlibruby extconf.rbmakesudo make installsudo gem install rails

that fixed the problem. This is similar to what other people posted above, but not exactly, so I figured I may as well post exactly what I did to get it going.


I have the same problem in CentOS and fix it by executing the following command:

First, I ensure that zlib and zlib-devel exist (like many suggested above).

yum install zlib zlib-devel

Second, I recompiled and installed the sources of zlib that comes with ruby.

cd /home/myname/installers/ruby-1.8.7-p174/ext/zlib/ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/libmakemake install

That commands seem to fix the problem, then I execute gem update --system and the error with zlib vanished. Then I install rails with gem install rails. Note to mention I had installed gem before, and after recompile and install zlib, I don't recompile neither install gem (actually I don't knew how uninstall it because I don't found a script to do that)

That works for me...hope to you to.

Regards.