如何使用ree-1.8.7在Ubuntu服务器10.04上安装mysql2

时间:2011-12-08 23:47:11

标签: ruby ubuntu-10.04 mysql2

当我尝试使用ree-1.8.7-2011.03在Ubuntu上安装mysql2时,我得到:

# gem install mysql2
Building native extensions.  This could take a while...

错误:安装mysql2时出错:     错误:无法构建gem原生扩展。

/usr/local/rvm/rubies/ree-1.8.7-2011.03/bin/ruby 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/opt/local/include -I. -I/usr/local/rvm/rubies/ree-1.8.7-

2011.03/lib/ruby/1.8/i686-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H  -D_FILE_OFFSET_BITS=64  -I/usr/include -fPIC -g -static-libgcc -fno-omit-frame-pointer   -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -fPIC -g -O2   -Wall -funroll-loops  -c client.c
    gcc  -I. -I/opt/local/include -I. -I/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/i686-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H  -D_FILE_OFFSET_BITS=64  -I/usr/include -fPIC -g -static-libgcc -fno-omit-frame-pointer   -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -fPIC -g -O2   -Wall -funroll-loops  -c mysql2_ext.c
./client.h:16: warning: ‘rb_thread_blocking_region’ defined but not used
    gcc  -I. -I/opt/local/include -I. -I/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/i686-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H  -D_FILE_OFFSET_BITS=64  -I/usr/include -fPIC -g -static-libgcc -fno-omit-frame-pointer   -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -fPIC -g -O2   -Wall -funroll-loops  -c result.c
    gcc -shared -o mysql2.so client.o mysql2_ext.o result.o -L. -L/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib -Wl,-R/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib -L.  -rdynamic -Wl,-    export-dynamic -Wl,-rpath,/usr/lib    -L/usr/lib -lmysqlclient_r -lpthread -lm -lrt -ldl  -L/opt/local/lib -lrt -ldl -lcrypt -lm   -lc
    /usr/bin/ld: cannot find -lmysqlclient_r
    collect2: ld returned 1 exit status
    make: *** [mysql2.so] Error 1

我不确定错误是什么。对原因有任何想法吗?

0 个答案:

没有答案