Can't run psql command, keep getting the same

2019-01-30 09:22发布

I just installed posgresql with homebrew and when I go on to type the command

psql

I get the following error:

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.2.dylib
Referenced from: /usr/local/bin/psql
Reason: image not found
[1]    69711 trace trap  psql

Does anyone have any idea about what's wrong?

20条回答
时光不老,我们不散
2楼-- · 2019-01-30 09:46

this worked for me

ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
查看更多
聊天终结者
3楼-- · 2019-01-30 09:47

You might want to check if you have anything else symlinked to postgresql. I had previously linked to the postgres93 package, which, as of May '17, is unsupported and has been removed. Removing that link and then relinking worked for me:

brew unlink postgresql93
brew link postgresql
查看更多
仙女界的扛把子
4楼-- · 2019-01-30 09:50

I had this problem when I updated readline to version 7 by accident. I uninstalled readline and brew remind me 6.3.8 is still installed. It seems that version 7 is not working with PSQL at the moment.

查看更多
戒情不戒烟
5楼-- · 2019-01-30 09:52

If the situation is you have a higher version readline say 7.0. You can do this

cd /usr/local/opt/readline/lib    
ln libreadline.7.0.dylib libreadline.6.2.dylib
查看更多
贪生不怕死
6楼-- · 2019-01-30 09:53

If you don't have readline installed, first install it:

brew install readline

For me, I was getting this error, even though I had readline installed. Reinstalling readline did the trick:

brew reinstall readline
查看更多
爱情/是我丢掉的垃圾
7楼-- · 2019-01-30 09:53

None of those solutions worked for me; I had to run :

brew upgrade bash

from : https://github.com/Homebrew/homebrew-core/issues/5799

查看更多
登录 后发表回答