在Mac上通过Homebrew安装PostgreSQL时出错



在Mac(OSX 10.11.6(上通过Homebrew安装PostgreSQL时,我收到以下错误:

Error: The `brew link` step did not complete successfully The formula
built, but is not symlinked into /usr/local

initdb: file "/usr/local/share/postgresql/postgres.bki" does not exist
This might mean you have a corrupted installation or identified the 
wrong directory with the invocation option -L.

/postgresql文件夹不存在。

不确定它是否相关,但我已经通过Homebrew安装了OpenSSL 1.0.2o_2和Readline 7.0.5。

有人知道为什么会出现这个错误,以及我如何解决它吗?

在我的案例中,我安装了libpq,它阻止了postgresql的链接。取消链接libpq然后链接postgresql为我修复了这个问题。

brew unlink libpq
brew link postgresql
brew postinstall postgresql

设法解决了问题。这是一个权限问题。原始答案可以在这里找到:Homebrew:无法符号链接,/usr/local/bin不可写

简而言之,执行以下命令:

sudo chown -R `whoami`:admin /usr/local/bin
sudo chown -R `whoami`:admin /usr/local/share
sudo chown -R `whoami`:admin /usr/local/opt

最新更新