# Gem\_original\_require zlib problem

**URL:** <https://www.ruby-forum.com/t/gem-original-require-zlib-problem/150467>\
**Category:** Ruby\
**Created:** [October 8, 2008, 10:21pm UTC](https://www.ruby-forum.com/t/gem-original-require-zlib-problem/150467 "2008-10-08T22:21:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevedogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9dc877/32.png) [@stevedogers](https://www.ruby-forum.com/u/stevedogers)\
**Post date:** [October 8, 2008, 10:21pm UTC](https://www.ruby-forum.com/t/gem-original-require-zlib-problem/150467/1 "2008-10-08T22:21:00Z")

</div>

I’m trying to just to a first time install of gems (and net/ssh ) in  
particular… and I can’t even do a

> gem update --system

I get the following dump (any idea how to fix this?)

/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require': no such file to load -- zlib (LoadError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
from  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/spec\_fetcher.rb:1  
from  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
from  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/commands/update\_command.rb:5  
from  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
from  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/command\_manager.rb:140:in  
`load_and_instantiate' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:65:in`[]’  
from  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/command\_manager.rb:118:in  
`find_command' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in`process\_args’  
from  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/command\_manager.rb:75:in  
`run' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in`run’  
from /usr/local/bin/gem:24

---

<div class="post-metadata">

**Author:** ![stevedogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9dc877/32.png) [@stevedogers](https://www.ruby-forum.com/u/stevedogers)\
**Post date:** [October 8, 2008, 11:05pm UTC](https://www.ruby-forum.com/t/gem-original-require-zlib-problem/150467/2 "2008-10-08T23:05:07Z")

</div>

On Wed, Oct 8, 2008 at 3:18 PM, Steve D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> /usr/local/lib/ruby/site\_ruby/1.8/rubygems/commands/update\_command.rb:5  
> /usr/local/lib/ruby/site\_ruby/1.8/rubygems/command\_manager.rb:65:in `[]' /usr/local/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:39:in `run’  
> from /usr/local/bin/gem:24

I had a similar error in Ubuntu, but I think I fixed it by making sure  
I had the development libraries for compression. That was a while  
ago, so I can’t recall exactly how I fixed it.

Todd

---

<div class="post-metadata">

**Author:** ![stevedogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9dc877/32.png) [@stevedogers](https://www.ruby-forum.com/u/stevedogers)\
**Post date:** [October 9, 2008, 10:11am UTC](https://www.ruby-forum.com/t/gem-original-require-zlib-problem/150467/3 "2008-10-09T10:11:22Z")

</div>

Steve D. wrote:

> I get the following dump (any idea how to fix this?)
> 
> /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> `gem\_original\_require’: no such file to load – zlib (LoadError)  
> from

If you built ruby itself from source, this means that the zlib extension  
wasn’t built at that time. This in turn probably means that you didn’t  
have the zlib development headers installed at the time.

Check you have a package called something like ‘zlib-devel’ and rebuild  
ruby.

---

<div class="post-metadata">

**Author:** ![stevedogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9dc877/32.png) [@stevedogers](https://www.ruby-forum.com/u/stevedogers)\
**Post date:** [October 9, 2008, 4:23pm UTC](https://www.ruby-forum.com/t/gem-original-require-zlib-problem/150467/4 "2008-10-09T16:23:40Z")

</div>

Brian C. wrote:

> Steve D. wrote:
> 
> > I get the following dump (any idea how to fix this?)
> > 
> > /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> > `gem\_original\_require’: no such file to load – zlib (LoadError)  
> > from
> 
> If you built ruby itself from source, this means that the zlib extension  
> wasn’t built at that time. This in turn probably means that you didn’t  
> have the zlib development headers installed at the time.
> 
> Check you have a package called something like ‘zlib-devel’ and rebuild  
> ruby.

I have been wrestling with this issue as well. How do I check for a  
package, and if I don’t have it, then what do i do?

---

<div class="post-metadata">

**Author:** ![stevedogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9dc877/32.png) [@stevedogers](https://www.ruby-forum.com/u/stevedogers)\
**Post date:** [October 9, 2008, 8:19pm UTC](https://www.ruby-forum.com/t/gem-original-require-zlib-problem/150467/5 "2008-10-09T20:19:19Z")

</div>

Hondo Burney wrote:

> Brian C. wrote:
> 
> > Steve D. wrote:
> > 
> > > I get the following dump (any idea how to fix this?)
> > > 
> > > /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> > > `gem\_original\_require’: no such file to load – zlib (LoadError)  
> > > from
> > 
> > If you built ruby itself from source, this means that the zlib extension  
> > wasn’t built at that time. This in turn probably means that you didn’t  
> > have the zlib development headers installed at the time.
> > 
> > Check you have a package called something like ‘zlib-devel’ and rebuild  
> > ruby.
> 
> I have been wrestling with this issue as well. How do I check for a  
> package, and if I don’t have it, then what do i do?

It appears that we were able to finally get Ruby to bind to the openssl  
through rebuilding a couple of different configurations on SUSE Linux  
10.

Thanks for all the pointers.

---

<div class="post-metadata">

**Author:** ![stevedogers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9dc877/32.png) [@stevedogers](https://www.ruby-forum.com/u/stevedogers)\
**Post date:** [October 9, 2008, 6:49pm UTC](https://www.ruby-forum.com/t/gem-original-require-zlib-problem/150467/6 "2008-10-09T18:49:33Z")

</div>

> > Check you have a package called something like ‘zlib-devel’ and rebuild  
> > ruby.
> 
> I have been wrestling with this issue as well. How do I check for a  
> package, and if I don’t have it, then what do i do?

Depends on what platform you’re using. For example:

On CentOS:  
rpm -qa | grep zlib  
yum install zlib-devel

On Ubuntu:  
dpkg-query -l | grep zlib  
apt-get install zlib1g-dev

# or something like that - I don’t have an Ubuntu box handy right now
