4

mysql2 gemを10.6サーバーにインストールしようとしていますが、表示されていないエラーメッセージが表示されます。

EBuilding native extensions.  This could take a while...
ERROR:  Error installing mysql2:
    ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing.  please check your installation of mysql and try again.
-----
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    --with-mysql-config
    --without-mysql-config


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/ext/mysql2/gem_make.out

組み込みのMySQLが格納されている場所を指定し、組み込みのsudo gem install mysql2 -- --with-mysql-dir=/var/mysqlmysqlをmysql.comのビルド済みの64ビットインストーラーに置き換えるなど、いくつかのことを試しました。

何か案は?

4

3 に答える 3

8

理解した:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
于 2010-12-12T23:39:39.173 に答える
7

私はあなたがパッケージをmysql-develインストールしなければならないことを知りました...Centos 実行してyum -y install mysql-devel 、あなたは行ってもいいです。

于 2011-10-19T20:25:27.803 に答える
3

「システム」Rubyインタープリターを備えたRVMを備えたOSX10.5でも同じ問題が発生します。RVMを介してRuby1.8.7を使用すると、状況が修正されました。

私は触発されました:https ://gist.github.com/440334#file_gistfile1.txt

于 2011-02-18T18:53:50.863 に答える