Philipps Blog

2008/07/03

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

Filed under: Geek,Tech,nexenta,ruby — philipp @ 9:59 pm

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

6 Comments »

  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

    thanks
    Mark

    Comment by mark thomas — 2008/07/05 @ 1:46 pm

  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.

    Comment by Philipp Haussleiter — 2008/07/05 @ 2:53 pm

  3. Wow, thanks, it helped!

    Comment by Anton — 2008/08/09 @ 11:44 pm

  4. Thanks a lot for this post, it definitely helped.

    Comment by Aric — 2008/09/10 @ 5:00 am

  5. [...] >> 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 [...]

    Pingback by Recent Links Tagged With "rubygems" - JabberTags — 2008/12/23 @ 3:04 am

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

    Comment by Letícia — 2009/04/28 @ 5:10 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress