200721/05

关于安装rubygems-0.9.3的zlib错误解决 Published by bugx 18:30:10 五月 21th,2007 in web种种.

初次接触Linux下RUBY环境安装,加上对linux的不熟悉,走了不少弯路。
特别是关于ruby1.8.65装好后装gems出现这个错误。
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/package.rb:9
终于在不懈的探索下,昨天晚上搞定了。

网上出现这个问题的人蛮多的,可能大家的编译环境不同,我尝试了他们的方法,折腾了2个晚上,终于发现解决之道。记下一笔,做为学习RUBY的一点经验积累。
我的系统环境是Red Hat AS4,最小化安装,所以会没有装上一些包,可能就出了这个问题。少了一个ruby-zlib,但当我根据网上的解决方法
ruby extconf.rb
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.
又出现了这个错误。明显少了zlib,用了Ubuntu的方法,又出现
apt-get install zlib1g-dev
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package zlib1g-dev
下了ruby-zlib也装不上
后来尝试用了apt-get install zlib-devel ,就可以了。
ruby extconf.rb
checking for deflateReset() in -lz... yes
checking for zlib.h... yes
checking for kind of operating system... Unix
creating Makefile
make
make install
再装rubygems的时候就非常顺利
Successfully built RubyGem
Name: sources
Version: 0.0.1
file: sources-0.0.1.gem
Removing old RubyGems RDoc and ri...
Installing rubygems-0.9.3 ri...
Installing rubygems-0.9.3 rdoc...

As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a while)...
...done.
No library stubs found.

新手上路,呵呵。

ruby  gem  

此文发于 2007-5-21 18:30:10,归类于 web种种,已阅读
Trackback引用地址:http://blog.nowans.com/trackback.asp?id=201
日志评论Feed地址:http://blog.nowans.com/feed.asp?o=comment&id=201

3条留言针对“关于安装rubygems-0.9.3的zlib错误解决” 订阅评论 发表评论

  • 无明火 2007.5.26 / 17:03 pm 1

    BugX前辈, 搞定RUBY环境了吖? ^^b

    Internet Explorer Internet Explorer 6.0  Windows Windows Server 2003
  • bugx 2007.5.27 / 15:02 pm 2

    哈哈,还是要谢谢你啊

    Internet Explorer Internet Explorer 6.0  Windows Windows Server 2003

假使你有话要讲,我想我还不至于拦着你罢: