そろそろ各ライブラリも1.9に対応してきたので。rails開発もruby1.8から1.9に移行。
今までのテストでも処理によるけど確実に2倍以上は早くなっている。
このまま1.8だとなにかと不安です。
ruby1.9・rubygems・railsなどのインストールは順調に進んだが、mysqlのインストールではまる。
結論から言うと、
「gemでインストールされるmysqlのバージョンが古いまま」
なのが原因でした。
なので1.9の場合は、直接本家にインストールしてあげる必要があるそうです。
エラー内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<textarea class="html" cols="60" rows="5" name="code"> gem install mysql Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /vol1/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 </textarea> |
以下、実行すれば解決。
1 2 3 4 5 6 7 8 |
<textarea class="html" cols="60" rows="5" name="code"> wget http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.8.1.tar.gz tar xzvf mysql-ruby-2.8.1.tar.gz cd mysql-ruby-2.8.1/ ruby19 extconf.rb --with-mysql-config make make install </textarea> |