# Installing Rails - Problem with zlib

**URL:** <https://www.ruby-forum.com/t/installing-rails-problem-with-zlib/153563>\
**Category:** Rails\
**Created:** [November 18, 2008, 8:08pm UTC](https://www.ruby-forum.com/t/installing-rails-problem-with-zlib/153563 "2008-11-18T20:08:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manouche](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@manouche](https://www.ruby-forum.com/u/manouche)\
**Post date:** [November 18, 2008, 8:08pm UTC](https://www.ruby-forum.com/t/installing-rails-problem-with-zlib/153563/1 "2008-11-18T20:08:34Z")

</div>

This is installed on CentOS 5.2.

I have installed Ruby 1.8.7

I downloaded and expanded Gem Manager 1.3.1 and Rails 2.1.2

I tried to install Rails using this:

gem install rails --include-dependencies

The result is this:

I understood that zlib was built into Ruby 1.8.7. Apparently not. So, I  
read about it and it was suggested that I manually build zlib. So, I  
downloaded ruby-zlib-0.6.0. Per the instructions, I ran this command:

ruby extconf.rb && make && make install

This is the result:

/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`gem\_original\_require’: no such file to load – zlib (LoadError)

Instlling ruby-zlib

checking for deflateReset() in -lz… no  
checking for deflateReset() in -llibz… no  
checking for deflateReset() in -lzlib… no  
\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

Can anyone provide some insight as to what I need to do to get Rails  
installed?

Thank you.

---

<div class="post-metadata">

**Author:** ![manouche](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@manouche](https://www.ruby-forum.com/u/manouche)\
**Post date:** [November 18, 2008, 8:33pm UTC](https://www.ruby-forum.com/t/installing-rails-problem-with-zlib/153563/2 "2008-11-18T20:33:13Z")

</div>

Christopher Adams wrote:

> The result is this:
> 
> I understood that zlib was built into Ruby 1.8.7. Apparently not. So, I  
> It is in that it is in the core ruby repository. It isn’t in that the  
> packages distributions like centos or debian create often carve ruby  
> up into ruby itself and separate out bits of ruby that depend on other  
> libraries (like zlib, openssl, readline etc…)

> Instlling ruby-zlib
> 
> checking for deflateReset() in -lz… no  
> checking for deflateReset() in -llibz… no  
> checking for deflateReset() in -lzlib… no  
> \*\*\* extconf.rb failed \*\*\*  
> Could not create Makefile due to some reason, probably lack of  
> necessary libraries and/or headers. Check the mkmf.log file for more  
> details. You may need configuration options.

The ruby-zlib library didn’t get installed as you might have guessed.  
While you almost certainly have the zlib libraries on your system, you  
may not have the associated headers etc… a lot of distros have a  
separate zlib-dev package or something along those lines. Get that,  
install ruby-zlib and you should be on your way (you might have to  
repeat the process with readline and/or openssl.

Fred

---

<div class="post-metadata">

**Author:** ![manouche](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@manouche](https://www.ruby-forum.com/u/manouche)\
**Post date:** [November 19, 2008, 1:32am UTC](https://www.ruby-forum.com/t/installing-rails-problem-with-zlib/153563/3 "2008-11-19T01:32:05Z")

</div>

Frederick C. wrote:

> Christopher Adams wrote:
> 
> > The result is this:
> > 
> > I understood that zlib was built into Ruby 1.8.7. Apparently not. So, I  
> > It is in that it is in the core ruby repository. It isn’t in that the  
> > packages distributions like centos or debian create often carve ruby  
> > up into ruby itself and separate out bits of ruby that depend on other  
> > libraries (like zlib, openssl, readline etc…)
> 
> > Instlling ruby-zlib
> > 
> > checking for deflateReset() in -lz… no  
> > checking for deflateReset() in -llibz… no  
> > checking for deflateReset() in -lzlib… no  
> > \*\*\* extconf.rb failed \*\*\*  
> > Could not create Makefile due to some reason, probably lack of  
> > necessary libraries and/or headers. Check the mkmf.log file for more  
> > details. You may need configuration options.
> 
> The ruby-zlib library didn’t get installed as you might have guessed.  
> While you almost certainly have the zlib libraries on your system, you  
> may not have the associated headers etc… a lot of distros have a  
> separate zlib-dev package or something along those lines. Get that,  
> install ruby-zlib and you should be on your way (you might have to  
> repeat the process with readline and/or openssl.
> 
> Fred

Fred,

Thank you for your reply. That is just what the doctor ordered. I am  
moving foreard again.
