0

Windows7x64にbzip2-rubygemをインストールしようとしました。この宝石が64ビットWindowsでも動作するかどうかはわかりません。C:\ Program Files(x86)\GnuWin32にインストールされたbzip2をインストールしました。

インストールするときは、次のコマンドを実行します。

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フォルダーを指定するときに、追加のオプションがないだけですか?

ありがとう!

4

1 に答える 1

0

GCC (RubyInstaller DevKit にバンドルされているコンパイラ) が正しく機能するには、スペースを含まないパスを使用する必要があります。

あなたが提供したオプションにextconfは、スペースを含むパスがあります。およびフォルダーを bzip2 からスペースなしのディレクトリーに再配置してlib、再試行してください。includebin

また、拡張機能のコンパイルを機能させるには、ヘッダー (includeディレクトリにある) とインポート ライブラリ (ディレクトリにある) の両方が必要です。lib

それが役立つことを願っています。

于 2012-06-14T00:49:12.993 に答える