mysql.hはシステムに存在しますが、ArchLinuxでこのエラーが発生します。誰かがこれを解決する方法を知っていますか?ここにいくつかのバイタルがあります:
$ find /usr -name mysql.h
/usr/include/mysql/mysql.h
$ echo $PATH
/home/chris/.rvm/gems/ruby-1.8.7-p302@bogen/bin:/home/chris/.rvm/gems/ruby-1.8.7-p302@global/bin:/home/chris/.rvm/rubies/ruby-1.8.7-p302/bin:/home/chris/.rvm/bin:/bin:/usr/bin:/usr/lib:/sbin:/usr/sbin:/home/chris/bin:/home/chris/lib:/usr/share/eclipse:/opt/kde/bin:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin:/usr/include:/usr/local/include:/opt/ruby1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl
これがの正確な出力ですgem install mysql
$ which ruby
/home/chris/.rvm/rubies/ruby-1.8.7-p302/bin/ruby
$ gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/home/chris/.rvm/rubies/ruby-1.8.7-p302/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
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=/home/chris/.rvm/rubies/ruby-1.8.7-p302/bin/ruby
--with-mysql-config
--without-mysql-config
Gem files will remain installed in /home/chris/.rvm/gems/ruby-1.8.7-p302@bogen/gems/mysql-2.8.1 for inspection.
Results logged to /home/chris/.rvm/gems/ruby-1.8.7-p302@bogen/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
これはArchlinuxであるため、UbuntuやCentOSのような開発パッケージはありません。私が試した上記のコマンドのバリエーションは次のとおりです。
gem install mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-config
gem install mysql -- --with-mysql-include=/usr/include/mysql
gem install mysql -- --with-mysql-include=/usr/include
すべて無駄に。残念ながら、私が見つけたこのエラーに関する他のすべてのレポートは、Mac OSに関係しているか、他のLinuxディストリビューションにdevelパッケージがないことに関係しています。私の状況ではヘッダーファイルがあり、標準的な場所にあるように見えるので、次に何を試すべきかわかりません。ヒントをいただければ幸いです。