MySQL ドライバのインストールに失敗する


gem から Ruby の MyDQL ドライバを入れたら失敗した。環境は CentOS 5。

$ ruby -v
ruby 1.8.5 (2006-08-25) [i386-linux]
$ gem -v
0.9.5
$ mysql -V
mysql  Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (i686) using readline 5.0
$ sudo gem install mysql
Updating metadata for 61 gems from http://gems.rubyforge.org
.............................................................
complete
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no

検索して、以下のようにオプションを付けたら成功した。

$ sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed

ただ、これで入っても、gem update すると同じエラーが出てしまう。

カテゴリー: Ruby   パーマリンク

コメントをどうぞ

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>