macos - brew install postgresql(升级)错误,无法链接 - 死链接到不存在的旧版本

标签 macos postgresql homebrew

Warning: Do not start deleting files manually in Terminal unless you've tried everything else first. Manual deletion may caused uninstall and install programs to crash.

这是 QA 风格的帖子,分享我解决问题的途径。我相信有更好的方法

我买了一台旧的 mac air 并想将其设置为进行 Ruby 和 Rails 培训。在升级过程中,我在安装 postgresql 时遇到了问题:

➜  ~  brew install postgresql
....
==> Installing postgresql
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/postgresql-9.3.5.mountain_lion.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/postgresql-9.3.5.mountain_lion.bottle.tar.gz
==> Pouring postgresql-9.3.5.mountain_lion.bottle.tar.gz
==> Caveats
...
To reload postgresql after an upgrade:
    launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
No such file or directory - /usr/local/Cellar/postgresql/9.2.3/include/server
Error: No such file or directory - /usr/local/Cellar/postgresql/9.2.3/include/server

我正在安装 postgresql 9.3.5,我一点也不在乎找不到 9.2.3!

➜  ~  brew install postgresql
Warning: postgresql-9.3.5 already installed, it's just not linked

但是 postgres 还是坏了。

有什么问题?

最佳答案

我遇到了类似的问题,但使用的是另一个包。原来有一堆死链接指向所有其他文件系统的旧版本。以下是对我的案例有帮助的内容:

  1. 运行 brew link <appname> (例如 brew link postgress );
  2. 如果成功完成那么你就是金牌,否则继续下一步;
  3. 查看错误消息中的路径(例如 /usr/local/Cellar/postgresql/9.2.3/include/server)通过删除 Cellar/来转换路径/ 来自它(例如 /usr/local/include/server)
  4. 在该路径下找到所有引用 Cellar// 的链接并将其删除;
  5. 转到第 1 步。

希望对你有帮助

关于macos - brew install postgresql(升级)错误,无法链接 - 死链接到不存在的旧版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25075888/

相关文章:

windows - 无法在 Mac OS X 主机上的 Windows 10 VirtualBox VM 中运行基于 docker 的 Windows 容器

macos - 使用 Homebrew 软件安装旧版本的 imagemagick

python - brew install python,然后是: "python-2.7.6 already installed, it' s just not linked"

homebrew - php-cs-fixer 在 php 7.3 更新后停止工作

swift - OSX - 从 NSTableView 中删除空单元格

macos - docker-machine:预创建检查错误: "exit status 126"

python - 无法安装表(Python、OS X)——找不到本地 HDF5 安装

java - eclipse中的SQL更新语句将更新数据库但会抛出SQL异常

sql - 如何从 `hh:mm:ss`中提取 `yyyy/mm/dd hh:mm:ss`

ruby-on-rails - rails 错误 : Index name '...' on table '...' already exists while running rails db:migrate