mysql导入so文件怎么打开,mysql2.so:libmysqlclient_r.so.15:无法打开共享对象文件:没有这样的文件或目录...

I am trying to run a Rails two app with Ubuntu 10.04 server, sphinx, myql2 version 0.2.7 and percona server 5.5 (Myslql 5.5). mysql2 in irb works ok, I can connect to the db. this rails 2 app is working in another Centos server with MySql 5.1. When I run:

script/server -e production

I get:

mysql2.so: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory

here are the libs I have:

# ls -l /usr/lib |grep sql

-rw-r--r-- 1 root root 10581008 2011-11-18 16:51 libmysqlclient.a

lrwxrwxrwx 1 root root 16 2011-12-10 05:48 libmysqlclient_r.a -> libmysqlclient.a

lrwxrwxrwx 1 root root 20 2011-12-10 05:48 libmysqlclient.so -> libmysqlclient.so.16

lrwxrwxrwx 1 root root 29 2011-12-10 06:01 libmysqlclient.so.15 -> /usr/lib/libmysqlclient.so.16

-rw-r--r-- 1 root root 7332 2011-11-18 16:44 libmysqlservices.a

-rw-r--r-- 1 root root 562520 2010-02-08 06:59 libsqlite3.a

-rw-r--r-- 1 root root 973 2010-02-08 06:59 libsqlite3.la

lrwxrwxrwx 1 root root 19 2011-12-07 17:15 libsqlite3.so -> libsqlite3.so.0.8.6

lrwxrwxrwx 1 root root 19 2011-03-09 18:43 libsqlite3.so.0 -> libsqlite3.so.0.8.6

-rw-r--r-- 1 root root 528668 2010-02-08 06:59 libsqlite3.so.0.8.6

drwxr-xr-x 3 root root 4096 2011-12-10 05:47 mysql

How can I fix it?

解决方案

If you encounter this error again after upgrading to 12.04 (or for people arriving here after googling the title of this page after upgrading to 12.04), the following worked for me:

gem uninstall mysql2

gem install mysql2

This will recompile the gem using libmysqlclient18, and worked for me.

Hope that helps someone out there.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值