pg 0.14.1:dyld:延迟符号绑定失败:找不到符号:_PQconnectdb [英] pg 0.14.1: dyld: lazy symbol binding failed: Symbol not found: _PQconnectdb

查看:93
本文介绍了pg 0.14.1:dyld:延迟符号绑定失败:找不到符号:_PQconnectdb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 El Capitan 上运行 postgresql 9.4.5 和 pg 0.14.1,在执行第一个查询时遇到以下错误,然后从 Rails 控制台退出:

Running postgresql 9.4.5 and pg 0.14.1 on El Capitan, and experiencing the following error followed by an exit from the Rails console when performing the first query:

dyld:懒惰的符号绑定失败:找不到符号:_PQconnectdb引用自:/Users/christian/Documents/Development/onelogin.com/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle预期在:平面命名空间

dyld: lazy symbol binding failed: Symbol not found: _PQconnectdb Referenced from: /Users/christian/Documents/Development/onelogin.com/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle Expected in: flat namespace

dyld:找不到符号:_PQconnectdb引用自:/Users/christian/Documents/Development/onelogin.com/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle预期在:平面命名空间

dyld: Symbol not found: _PQconnectdb Referenced from: /Users/christian/Documents/Development/onelogin.com/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle Expected in: flat namespace

跟踪/BPT陷阱:5

有什么想法吗?

推荐答案

这意味着 gem 编译所针对的 libpq 库丢失或由于某种原因不再可加载.通常,您需要在操作系统升级后或安装新版本的 XCode 命令行工具后重新安装 PostgreSQL.

This means that the libpq library the gem was compiled against is missing or is no longer loadable for some reason. Oftentimes you'll need to reinstall PostgreSQL after an OS upgrade, or after installing a new version of the XCode command line tools.

您可以像这样查看 gem 尝试加载的库(无论如何在 OSX 上):

You can look at the library the gem is trying to load like this (on OSX anyway):

file $(otool -L/Users/christian/Documents/Development/onelogin.com/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle | grep libpq | cut -f1 -d' ')

它应该看起来像这样:

/usr/local/lib/libpq.5.dylib: Mach-O 64 位动态链接共享库 x86_64

我的 PostgreSQL 是通过 Homebrew 安装的,所以你的路径可能不同,但它至少应该显示一个共享库.如果看起来没问题,请在评论中发表评论,我会尽力提供进一步帮助.

My PostgreSQL is installed via Homebrew, so your path might be different, but it should at least show a shared library. If it looks okay, post what it says in a comment and I'll try to help further.

这篇关于pg 0.14.1:dyld:延迟符号绑定失败:找不到符号:_PQconnectdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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