mysql2.so:libmysqlclient_r.so.15:无法打开共享对象文件:没有这样的文件或目录 [英] mysql2.so: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory

查看:229
本文介绍了mysql2.so:libmysqlclient_r.so.15:无法打开共享对象文件:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Ubuntu 10.04服务器,狮身人面像,myql2版本0.2.7和percona服务器5.5(Myslql 5.5)运行Rails两个应用程序. irb中的mysql2可以正常工作,我可以连接到数据库.这个rails 2应用程序正在另一个带有MySql 5.1的Centos服务器中工作.当我跑步时:

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 

我得到:

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

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

这是我拥有的库:

# 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

我该如何解决?

推荐答案

如果升级到12.04后再次遇到此错误(或对于升级到12.04后谷歌搜索此页面标题后到达的人),以下方法适用我:

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

这将使用libmysqlclient18重新编译gem,并为我工作.

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

希望能帮助某个人.

这篇关于mysql2.so:libmysqlclient_r.so.15:无法打开共享对象文件:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆