2013-02-14 4 views
0

Вот мой стек:Не удалось установить mysql2 камень на RHEL 5.8 через Bundler

  • RHEL 5.8 x86_64
  • MySQL 5.5 x86_64
  • Рубин 1.9.3p345
  • Rails 3.2.8

Я устанавливаю mysql2 0.3.11 gem через bundler и получил ошибку, и проблема, похоже, не совпадает с популярными ошибками в Ruby gem mysql2 install failing a d mysql2 gem installation fails. Это пакеты, которые я уже установил для mysql.

[[email protected] config]$ yum list installed | grep MySQL 
Unable to read consumer identity 
MySQL-client.x86_64     5.5.29-1.rhel5     installed 
MySQL-devel.x86_64     5.5.29-1.rhel5     installed 
MySQL-python.x86_64     1.2.3-0.1.c1.el5     installed 
MySQL-server.x86_64     5.5.29-1.rhel5     installed 
perl-DBD-MySQL.x86_64     3.0007-2.el5      installed 
[[email protected] config]$ yum list installed | grep mysql 
Unable to read consumer identity 
libdbi-dbd-mysql.x86_64    0.8.1a-1.2.2      installed 

Сообщение об ошибке выглядит следующим образом:

Installing mysql2 (0.3.11) with native extensions 

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
/home/user/.rvm/rubies/ruby-1.9.3-p385/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 result.c 
In file included from ./mysql2_ext.h:39, 
      from result.c:1: 
./client.h:42:7: warning: no newline at end of file 
compiling mysql2_ext.c 
In file included from ./mysql2_ext.h:39, 
      from mysql2_ext.c:1: 
./client.h:42:7: warning: no newline at end of file 
compiling client.c 
In file included from ./mysql2_ext.h:39, 
      from client.c:1: 
./client.h:42:7: warning: no newline at end of file 
client.c: In function a€?rb_raise_mysql2_errora€?: 
client.c:98: warning: ISO C90 forbids mixed declarations and code 
client.c: In function a€?rb_mysql_client_socketa€?: 
client.c:590: warning: ISO C90 forbids mixed declarations and code 
linking shared-object mysql2/mysql2.so 
/usr/bin/ld: cannot find -lmysqlclient_r 
collect2: ld returned 1 exit status 
make: *** [mysql2.so] Error 1 


Gem files will remain installed in /home/user/.rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11 for inspection. 
Results logged to /home/user/.rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/ext/mysql2/gem_make.out 
An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue. 
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling. 
+1

ли вы установили библиотеку mysqlclient? – PinnyM

+0

@PinnyM У меня установлен mysql-клиент, но я понятия не имею, есть ли там mysqlclient_r ... – Xiaoli

+0

Хорошо, нет ответа ... хотя я переустановил MySQL из исходного кода, и ошибка ушла ... – Xiaoli

ответ

0

попробовать и использовать

bundle config build.mysql2 --with-mysql-config=/.../mysql_config 

или

sudo gem install mysql2 -- --with-mysql-config=/.../mysql_config 
Смежные вопросы