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

Rob*_*rji 3 postgresql macos homebrew

在 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
Run Code Online (Sandbox Code Playgroud)

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.
Run Code Online (Sandbox Code Playgroud)

/postgresql文件夹不存在。

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

有谁知道为什么会出现此错误以及如何解决它?

小智 13

就我而言,我安装了 libpq,它阻止了 postgresql 链接。取消链接 libpq 然后链接 postgresql 为我解决了这个问题。

brew unlink libpq
brew link postgresql
brew postinstall postgresql
Run Code Online (Sandbox Code Playgroud)

  • 这对我来说是同样的情况 (2认同)