使用RailInstaller在Windows上安装gem:"您必须安装zlib"

时间:2014-04-14 22:40:41

标签: ruby

我在Windows上,使用RailsInstaller安装了Ruby 2.0。

当我尝试使用gem install id3lib-ruby安装id3lib-ruby时,我得到以下内容:

Temporarily enhancing PATH to include DevKit... 
Building native extensions.  This could take a while... 
ERROR:  Error installing id3lib-ruby:
        ERROR: Failed to build gem native extension.

    C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb 
checking for main() in -lstdc++... yes 
checking for main() in -lz... no You must have zlib installed.
*** 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.

在mkmf.log中,它包含以下行:

c:/railsinstaller/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lz
collect2: ld returned 1 exit status

我在zlib1.dll中有C:\RailsInstaller\Ruby2.0.0\bin,将文件重命名为zlib.dll不起作用。因此,看起来RubyInstaller已经包含了zlib库,但仍然导致gem安装失败。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

无法解决问题。通过安装RailsInstaller 2.2.2(Ruby 1.9.3)和taglib-ruby来“修复”。