私は次のようなクリーンなビルドシステムを持っています
Ubuntu 11.04
Rvm 1.13.5
Ruby 1.9.3p194
Rails 3.2.3
宝石1.8.24
MySql 5.5.24-1(/ usr / localにインストール)
mysql2 gem(0.3.11)をインストールしようとしていますが、次の問題が発生します。
pal@smurf01:~$ sudo gem install mysql2
[sudo] password for pal:
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... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make
compiling client.c
client.c: In function 'rb_raise_mysql2_error':
client.c:98:3: warning: ISO C90 forbids mixed declarations and code
client.c: In function 'rb_mysql_client_socket':
client.c:590:3: warning: ISO C90 forbids mixed declarations and code
compiling mysql2_ext.c
compiling result.c
linking shared-object mysql2/mysql2.so
/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient_r.so when searching for -lmysqlclient_r
/usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient_r.a when searching for -lmysqlclient_r
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
make: *** [mysql2.so] Error 1
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
pal@smurf01:~$
最初の質問:UbuntuでMySql5.5.1でRailsmysql2を実行している人はいますか?5.1を搭載した別のシステムで実行しています。サポートされているMySqlバージョンでは、gemの説明があいまいです。
2番目の質問:誰かがこの問題に遭遇しましたか?I±は、過去1年ほどの間、mysql2 gemを使用してさまざまなライブラリの問題と戦ってきましたが、これは異なるようです。
どんな援助もありがたく受けます。
ところで:MySql 5.1に戻すことは有効な解決策です!
よろしく
ピーター