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.

root@sunny:~# wget
root@sunny:~# unzip
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

6 Replies to “Install Gems (Ruby with zlib) on Nexenta (GnuSolaris) 1.01”

  1. 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


  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.

Leave a Reply