我尝试在Windows7 x64上安装bzip2-ruby gem。现在我不知道这个gem是否能在64位Windows上运行。我确实安装了bzip2,它安装在C:\Program Files (x86)\GnuWin32目录下。
当我开始安装时,运行以下命令:
gem install bzip2-ruby -- --with-bz2-dir="C:\Program Files (x86)\GnuWin32\"当它运行时,我得到以下输出:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
*** 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=C:/Ruby193/bin/ruby
--with-bz2-dir
--with-bz2-include
--without-bz2-include=${bz2-dir}/include
--with-bz2-lib
--without-bz2-lib=${bz2-dir}/lib
--with-bz2lib
--without-bz2lib
ERROR: Error installing bzip2-ruby:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb --with-bz2-dir=C:\Program Files (x86)\GnuWin32"
checking for bzlib.h... no
checking for BZ2_bzWriteOpen() in -lbz2... no
libbz2 not found, maybe try manually specifying --with-bz2-dir to find it?
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/bzip2-ruby-0.2.7 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/bzip2-ruby-0.2.7/ext/gem_make.out我可以验证libbz2.a、libbz2.def和libbz2.dll.a文件是否存在于上述路径下的lib文件夹中。
在运行指定lib文件夹的命令时,我是否错过了一个额外的选项?
谢谢!
发布于 2012-06-14 08:49:13
为了让GCC (捆绑在RubyInstaller DevKit中的编译器)正常工作,您需要使用不带空格的path 。
您提供的extconf选项有一个带有空格的路径。请将lib、include和bin文件夹从bzip2重新定位到不带空格的目录中,然后重试。
此外,您需要同时拥有头文件(位于include目录中)和导入库(位于lib目录中),扩展编译才能正常工作。
希望这能有所帮助。
https://stackoverflow.com/questions/11018454
复制相似问题