2

OS X Server 10.6 に mysql ruby​​ gem をインストールする際に問題が発生しました。

これは私が得ているエラーです:

macserver:~ admin$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-       config=/usr/bin/mysql_config

Building native extensions. This could take a while…

ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/Users/admin/.rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb --with-mysql-config=/usr/bin/mysql_config

checking for mysql_ssl_set()… yes
checking for rb_str_set_len()… yes
checking for rb_thread_start_timer()… yes
checking for mysql.h… no
checking for mysql/mysql.h… 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=/Users/admin/.rvm/rubies/ruby-1.8.7-p371/bin/ruby
--with-mysql-config

Gem files will remain installed in /Users/admin/.rvm/gems/ruby-1.8.7-p371/gems/mysql-2.9.1 for inspection.
Results logged to /Users/admin/.rvm/gems/ruby-1.8.7-p371/gems/mysql-2.9.1/ext/mysql_api/gem_make.out

どんな助けでも大歓迎です。

4

1 に答える 1

1

MySQL の開発ヘッダーがインストールされている必要があります。Oracle のデフォルトのバイナリ パッケージには、これらが含まれていません。

Homebrew または MacPorts のいずれかを使用している場合、これらの両方で必要なファイルを提供できます。

于 2013-03-08T20:13:24.940 に答える