Mac psql / readline-未加载库 [英] Mac psql/readline - Library not loaded

查看:109
本文介绍了Mac psql / readline-未加载库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上使用Sierra 10.12.3,并且正在尝试通过 psql 命令访问PostgreSQL数据库,但是它引发了错误

I'm working on a Mac, Sierra 10.12.3, and I'm trying to access a PostgreSQL database via the psql command, but it threw the error

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
Referenced from: /usr/local/bin/psql
Reason: image not found
Abort trap: 6

在一两天前,我正在和某人一起工作,需要安装pip,所以我跑了 brew install pip ,这一切都很好。从那以后,这是我第一次尝试运行 psql ,但我不确定这与我的问题有什么关系,但是似乎很可能是因为我没有

A day or two ago, I was working with someone and I needed to install pip, so I ran brew install pip, and it was all good. This is the first time I'm trying to run psql since then and I'm not certain that this has anything to do with my problem, but it seems likely since I haven't made any other changes.

现在我做了一些侦探工作,发现如果我去 / usr / local / opt / 确实存在一个 readline 别名目录,该目录指向 /usr/local/Cellar/readline/7.0.1 (似乎也已经安装了7.0.1版-可能作为pip的一部分?也许我是错误地做的...),因此应该抛出原始错误在某种意义上是合理的。我将别名更改为指向 /usr/local/Cellar/readline/6.3.8 ,错误略有变化:

Now I did a little detective work and found that if I went to /usr/local/opt/ there was indeed a readline alias directory that pointed to /usr/local/Cellar/readline/7.0.1 (version 7.0.1 also seeming to have gotten installed at some point - maybe as part of pip? Maybe I did it by mistake...) so it made some sense that the original error should be thrown. I changed the alias to point to /usr/local/Cellar/readline/6.3.8 and the error changed slightly:

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
Referenced from: /usr/local/bin/psql
Reason: no suitable image found.  Did find:
/usr/local/opt/readline/lib/libreadline.6.dylib: stat() failed with errno=20
Abort trap: 6

所以我似乎在某个地方遇到了 ,但仍然遇到了问题。如果有人可以提出解决方案,我将永远感激不已。

So it seems like I'm getting somewhere, but still having an issue. If anyone can shed some light on a solution, I would be forever grateful.

推荐答案

我能够通过简单地运行来解决此问题。 酿造开关阅读线6.3.8

I was able to resolve this by simply running brew switch readline 6.3.8

这篇关于Mac psql / readline-未加载库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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