乘客错误“库未加载" [英] Passenger error "library not loaded"

查看:79
本文介绍了乘客错误“库未加载"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从旅客(使用Apache)获取此错误.不知道这意味着什么...

Getting this error from Passenger (with Apache). Not sure what it means...

 dlopen(/path/to/myapp/shared/bundle/ruby/1.9.1/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): 
 Library not loaded: /usr/local/mysql/lib/libmysqlclient.16.dylib 
 Referenced from: /path/to/myapp/shared/bundle/ruby/1.9.1/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle 
 Reason: image not found - /path/to/myapp/shared/bundle/ruby/1.9.1/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle

已安装的Ruby实际上是1.9.2,但无论出于何种原因,宝石都在此"1.9.1"路径中...

The Ruby installed is actually 1.9.2 but the gems are in this "1.9.1" path for whatever reason...

这与我使用mysql2 gem而不是mysql的事实有关吗?

Could it have something to do with the fact I'm using the mysql2 gem instead of mysql?

或者,它可能与第二行"库未加载"有关,看起来好像它正在尝试加载错误的libmysqlclient.16.dylib?由于路径/usr/local/mysql指向未运行的mysql版本. /usr/bin/中正在运行的mysql版本. 我会尝试更改此设置,但我不知道如何!?!

Or, maybe could it have something to do with the 2nd line "Library not loaded" where it looks like it might be trying to load the wrong libmysqlclient.16.dylib? As the path /usr/local/mysql points to a version of mysql that is not running. The version of mysql that is running is in /usr/bin/. I'd try to change this but I have no idea how!?!

推荐答案

此版本为库兼容版本". Ruby 1.9.2几乎与1.9.1兼容,因此该库安装在1.9.1目录中.

This version is "librariry compatible version". Ruby 1.9.2 is almost 1.9.1 compatible, so the library is installed in 1.9.1 direcotry.

这就是为什么 ruby​​ 目录被命名为"1.9.1"的原因;是正常的.

That is why the ruby directories are named "1.9.1"; it is normal.

您的 mysql2 gem实例是针对/usr/local/mysql/lib/libmysqlclient.16.dylib库构建的.由于某种原因,该库当前在该路径名下无法在您的系统上使用(已删除/移动/升级了MySQL?).

Your instance of the mysql2 gem was built against the /usr/local/mysql/lib/libmysqlclient.16.dylib library. For one reason or another, that library is not currently available on your system at that pathname (MySQL removed/moved/upgraded?).

您可能需要重建 mysql2 gem并将其从MySQL安装(在/usr/bin中?)指向mysql_config(或mysql_config5):

You probably need to rebuild your mysql2 gem and point it to the mysql_config (or mysql_config5) from your MySQL installation (in /usr/bin?):

gem install mysql2 -- --with-mysql-config=/usr/bin/mysql_config

这篇关于乘客错误“库未加载"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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