난 레일 애플 리케이션에 루비에 mysql2 보석을 설치하려고 해요. 나는 현재 우분투 11.04를 실행하는거야 내가 실행할 때이 내가 오류입니다 sudo gem install mysql2
또는 bundle install
:많은 제안을 시도했지만, mysql2 gem을 어떻게 설치합니까?
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... no
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -funroll-loops -c client.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -funroll-loops -c mysql2_ext.c
./client.h:16:1: warning: ‘rb_thread_blocking_region’ defined but not used
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -funroll-loops -c result.c
gcc -shared -o mysql2.so client.o mysql2_ext.o result.o -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -Wl,-rpath,/usr/lib/x86_64-linux-gnu -lruby1.8 -L/usr/lib/x86_64-linux-gnu -lmysqlclient_r -lpthread -lz -lm -lrt -ldl -lpthread -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
make: *** [mysql2.so] Error 1
Gem files will remain installed in /var/lib/gems/1.8/gems/mysql2-0.3.11 for inspection.
Results logged to /var/lib/gems/1.8/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
나는 내가 libmysqlclient-DEV와 libmysql 루비 라이브러리를 설치 한,되는 mysql_config로 설치 시도했습니다, 나는 제거하고 MySQL을 다시 설치하려고했습니다. 그것들 중 아무 것도 작동하지 않습니다. 나는 mysql 젬을 성공적으로 설치할 수 있지만 mysql2는 설치할 수 없다.
저는 ruby1.8과 Rails 2.3.5를 사용하고 있습니다. 누구든지 나를 도울 수 있습니까?
감사합니다. 나는 그것을 시험해 본다. –
업그레이드 할 기회가 있었습니까? 그렇다면 어떻게 도움이 되었습니까? –
다른 프로젝트에서 작업해야하므로 실제로 테스트 할 기회가 없었습니다. 내가 돌아올 때 알려주지. –