安裝gem install -l zlib-1.1.0.gem
時報以下錯誤:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
解決方式:
1、cd ruby/ruby-2.5.1/ext/zlib
目錄
ruby ./extconf.rb
make
make install
2、make時報錯:make: *** No rule to make target /include/ruby.h', needed by
zlib.o’. Stop.
3、更改Makefile文件,
zlib.o: $(top_srcdir)/include/ruby.h
改成
zlib.o: ../../include/ruby.h;
然後重新make就可以了。
4、cd ruby/ruby-2.5.1/ext/openssl目錄執行 ruby ./extconf.rb、make 、make install命令。