1.问题概述
MacOS上使用Homebrew安装postgres时报错
安装命令:brew install postgres
报错信息:Error: postgresql: Invalid bottle tag symbol。
2.解决方案
使用命令:brew edit postgres,打开postgres的formula:
class Postgresql < Formula
desc "Object-relational database system"
homepage "https://www.postgresql.org/"
url "https://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.bz2"
sha256 "ad1dcc4c4fc500786b745635a9e1eba950195ce20b8913f50345bb7d5369b5de"
revision 1
head "https://github.com/postgres/postgres.git"
<其他配置...>
bottle do
sha256 arm64_monterey: "fe137ea6536535299a666ea9e126e84fd58712d25c7071073bb4053da70ad2f0"
sha256 arm64_big_sur: "b0a1686c5c5ba668e78a97d66567e9d007f7d2a0c9b1a53e79841e3736d729e6"
sha256 monterey: "d40731741ca7d7b16b791fa31d21baab674720c87c00adbf54ca796ff80b9b0f"
end
<其他配置...>
将bottle do和end及其之间的内容删除,结果如下:
class Postgresql < Formula
desc "Object-relational database system"
homepage "https://www.postgresql.org/"
url "https://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.bz2"
sha256 "ad1dcc4c4fc500786b745635a9e1eba950195ce20b8913f50345bb7d5369b5de"
revision 1
head "https://github.com/postgres/postgres.git"
<其他配置...>
<其他配置...>
退出时,记得wq。
重新执行安装命令:brew install postgres 即可。