私のスタックは次のとおりです。
- CentOS 6.3
MySQL 5.5 をインストールしました (http://www.if-not-true-then-false.com/2010/install-mysql-on-fedora-centos-red-hat-rhel/ の手順に従いました。 mysql関連のパッケージをyumインストールしようとすると、yumが5.1を期待するため、もちろん壊れます)
$> mysql --version mysql Ver 14.14 Distrib 5.5.27、Linux (x86_64) 用 readline 5.1 を使用
$> ruby --version ruby 1.9.3p194 (2012-04-20 リビジョン 35410) [x86_64-linux]
$> rvm --version rvm 1.14.6 (安定版) by Wayne E. Seguin , Michal Papis [https://rvm.io/]
$> uname -a Linux localhost.mkf 2.6.32-279.5.1.el6.x86_64 #1 SMP Tue Aug 14 23:54:45 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$> nginx -v nginx バージョン: nginx/1.2.2
$> rails -v Rails 3.2.6
mysql2 gem をインストールしようとすると、次のエラーが発生します。
$> gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
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
--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=/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-mysql-config
--without-mysql-config
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2-0.3.11 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/mysql2- 0.3.11/ext/mysql2/gem_make.out
私がする時
$> find / -name mysql.h
何も得られない
Mysql は適切に実行されており、データベースとテーブルを既に作成しており、SQL は問題なく実行されています。
スタックに mysql2 gem をインストールすることはできますか? もしそうなら、私が見逃しているものは何ですか?
更新: yum install mysql-devel
Remi リポジトリを使用して mysql5.5 がインストールされているため、エラーをスローしようとしました。Yum は mySql 5.1 を想定していますが、