1

私はこのエラーを探していて、すべてを再インストールし、すべてを試しました。ここで見つけたのは古い投稿と古いバージョンだけです。はい、MySQL C Connector をダウンロードし、lib をその ruby​​ ディレクトリに移動しました。まだ何もありません。

PC WINx64 Ruby バージョン 2.0.0-p195 DevKit の最新バージョンを実行しています

**gem install mysql2**
**Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

    C:/Ruby200/bin/ruby.exe extconf.rb
checking for main() in -llibmysql... 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=C:/Ruby200/bin/ruby
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/
        --with-libmysqllib
        --without-libmysqllib


Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1/ext/mysql_api/gem_make.out**

B:\ROR\hcv>

Windows は常に問題を引き起こします。しかし、これは私が職場で持っているすべてです。君たちありがとう。

4

2 に答える 2

0

次のコマンドを使用して mysql gem をインストールしてみてください

gem install mysql2 -- '--with-mysql-lib="c:\Program Files\MySQL\MySQL Server 5.0\lib\opt" --with-mysql-include="c:\Program Files\MySQL\MySQL Server 5.0\include"'

注:インストールごとにmysqlインストールディレクトリを変更してください

于 2013-08-20T12:16:42.437 に答える