pg 0.14.1:dyld:延迟符号绑定失败:找不到符号:

编程入门 行业动态 更新时间:2024-10-28 15:32:04
本文介绍了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/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/vendor/bundle/gems/pg-0.14.1/lib/pg_ext.bundle Expected in: flat namespace

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

dyld: Symbol not found: _PQconnectdb Referenced from: /Users/christian/Documents/Development/onelogin/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/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:延迟符号绑定失败:找不到符号:

本文发布于:2023-10-26 14:45:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1530452.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:符号   找不到   绑定   pg   dyld

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!