Share

Install Gems (Ruby with zlib) on Nexenta (GnuSolaris) 1.01

Next in the row is the installation of the ruby gems package.
So it should be easy… just following the instructions.
So…..

root@sunny:~# wget http://rubyforge.org/frs/download.php/38647/rubygems-1.2.0.zip
root@sunny:~# unzip rubygems-1.2.0.zip
root@sunny:~# cd rubygems-1.2.0
root@sunny:~# ruby setup.rb config
./lib/rubygems/spec_fetcher.rb:1:in `require’: no such file to load — zlib (LoadError)
from ./lib/rubygems/spec_fetcher.rb:1
from ./lib/rubygems/source_index.rb:10:in `require’
from ./lib/rubygems/source_index.rb:10
from ./lib/rubygems.rb:767:in `require’
from ./lib/rubygems.rb:767
from setup.rb:22:in `require’
from setup.rb:22

Welcom to error world ;-).
Okay…. should be easy to solve:

root@sunny:~# apt-get install libzlib-ruby zlib1g-dev

or for 64bit Plattforms:

root@sunny:~# apt-get install libzlib-ruby lib64z1-dev

But still the same Error!
Finally i found something in the Weblog of Lucas Chan.
Hm its about readhat/centos…. okay why not.
Just go to the ruby sources:

root@sunny:~# cd /usr/local/src/ruby-1.8.6-p110/
root@sunny:~# cd ext/zlib
root@sunny:~# ruby ruby extconf.rb –with-zlib-include=/usr/include –with-zlib-lib=/usr/lib
checking for deflateReset() in -lz… yes
checking for zlib.h… yes
checking for kind of operating system… Unix
creating Makefile

root@sunny:~# make
root@sunny:~# make install

and finally:

root@sunny:~# cd /usr/local/src/rubygems-1.2.0/
root@sunny:~# ruby setup.rb config
….
== Thanks

Keep those gems coming!

— Jim & Chad & Eric (for the RubyGems team)

Again: something learned!

Blogged with the Flock Browser

You may also like...

6 Responses

  1. mark thomas says:

    Thanks for posting that. I found your site when I googled for the error. I had the same issue.
    can you tell me exactly what your command did?
    root@sunny:~# ruby extconf.rb ruby extconf.rb –with-zlib-include=/usr/include –with-zlib-lib=/usr/lib

    thanks
    Mark

  2. Hello Mark,

    there was an error:
    the line should be:
    root@sunny:~# ruby ruby extconf.rb –with-zlib-include=/usr/include –with-zlib-lib=/usr/lib

    It just sets the lib and header path for the zlib extension.
    Normally if you use apt-get you should already have this extension delivered with your ruby package. In my case, i compiled Ruby myself. The gem installer uses the zlib extension so i had to compile this extension manually.

  3. Anton says:

    Wow, thanks, it helped!

  4. Aric says:

    Thanks a lot for this post, it definitely helped.

  5. Letícia says:

    OMG, thank you so much! I was getting crazy about this zlib stuff!

  1. 2008-12-23

    […] >> rubygems Rubyでどう書く?特別編:Matzか… Saved by Irishize on Wed 10-12-2008 Install Gems (Ruby with zlib) on Nexenta (GnuSolaris) 1.01 Saved by warnerbrosrecords on Mon 08-12-2008 Rails failing to recognize RubyGems on OS X? Saved […]

Leave a Reply