weixin_42407776
2010-12-27 18:11
浏览 348
已采纳

安装mysql gem的奇怪错误 谁能帮我一下 谢谢

Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/local/ruby/bin/ruby extconf.rb
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... yes
checking for mysql.h... yes
creating Makefile

make
gcc -I. -I. -I/usr/local/ruby/lib/ruby/1.8/x86_64-linux -I. -DHAVE_MYSQL_SSL_SET -DHAVE_RB_THREAD_START_TIMER -DHAVE_MYSQL_H -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -DUNIV_LINUX -DUNIV_LINUX -fPIC -g -Os -fno-strict-aliasing -c mysql.c
gcc -shared -o mysql_api.so mysql.o -L. -L/usr/local/ruby/lib -Wl,-R/usr/local/ruby/lib -L. -rdynamic -Wl,-export-dynamic -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lmygcc -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [mysql_api.so] Error 1

Gem files will remain installed in /usr/local/ruby/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/local/ruby/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • Tadas-Gao 2010-12-28 09:35
    已采纳

    mysql-dev装了吗

    点赞 评论
  • Tadas-Gao 2010-12-28 08:17

    ln -s /usr/lib64/libmysqlclient.* /usr/lib/

    点赞 评论
  • hyz06225217 2012-07-25 17:03

    你好,请问这个问题你是怎么解决的呢?我在ubuntu10.04和11.04上安装都没有问题,但是在12.04上安装就有这个问题了。

    点赞 评论

相关推荐 更多相似问题