2010-12-12 1 views
4

は私が10.6サーバ上でmysql2の宝石をインストールしようとしていると私は見ていないエラーメッセージを取得Mysql2 gem- 10.6 Serverのインストール:、私はカップルの事を試してみたエラー

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/mysqlまた、mysql.comの組み込みの64ビットインストーラで組み込みのmysqlを置き換える

アイデアはありますか?

答えて

8

はそれを考え出した:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config 
+0

おかげで、私は – klochner

+0

を取得しました。 'env'が内部または外部コマンド、実行可能プログラムまたはバッチファイルとして認識されません。 –

+0

Totty、実行中のOS Xのバージョンは何ですか?あなたはsudoを使いましたか? – christo16

7

私はyum -y install mysql-develを行うCentos で...あなたはパッケージインストールmysql-develを持っている必要が出ていて、あなたが行ってもいいです。

+2

これはCentOS上では便利ですが、OPはMac OSについて質問しています。 –