no such file to load -- zlib when using gem install

今天在buntu10.10使用源码安装完ruby1.9.2p290和rubygem1.8.10后,想利用gem去安装rails: gem install rails,结果提示  no such file to load -- zlib 错误。

zlib is a library implementing the deflate compression method found
in gzip and PKZIP. 

解决办法,安装zlib1g 和 zlib1g-dev 包(apt-get install 或者利用Synaptic),然后

1.回到ruby源码目录/ext/zlib 下

2. ruby extconf.rb

3. make && make install

问题解决。

posted on 2011-09-21 15:30  -Anny-  阅读(319)  评论(0编辑  收藏  举报