需要安装zlib ,
1.编译安装zlib
2.进入源码包,/ext/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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/ruby/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-zlib
--without-zlib
--with-libzlib
--without-libzlib
--with-zliblib
--without-zliblib3.红色字体的参数是一定要添加的
$ruby extconf.rb --with-zlib-dir
=/usr/local/zlib
$ sudo
make
$ sudo make install