执行 brew install postgresql
时报错“No such file or directory @ rb_sysopen …”
用 brew 单独下载依赖包 [email protected]
brew install [email protected]
再次执行 postgresql 的安装命令,成功!
(ll_env) chengrui@chengruis-MacBook-Air learning_log % brew install postgresql
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/krb5-1.19.3
Already downloaded: /Users/chengrui/Library/Caches/Homebrew/downloads/0255cb72987b98c06ce7e4dfee44fd76588ea5c718ba6ff6bcf19a43f3684d48--krb5-1.19.3.arm64_monterey.bottle.tar.gz
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/readline-8.
Already downloaded: /Users/chengrui/Library/Caches/Homebrew/downloads/39a84bfc99390b41af3e6aa9252a345e71111216ca4365ac1356c989d9b5994e--readline-8.1.2.arm64_monterey.bottle.tar.gz
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/postgresql-
Already downloaded: /Users/chengrui/Library/Caches/Homebrew/downloads/a35a60439201db3723c0842db62b3368de4fafdedcde41a5dfb642232f32fb20--postgresql-14.2_1.arm64_monterey.bottle.tar.gz
==> Installing dependencies for postgresql: krb5 and readline
==> Installing postgresql dependency: krb5
==> Pouring krb5-1.19.3.arm64_monterey.bottle.tar.gz
/opt/homebrew/Cellar/krb5/1.19.3: 162 files, 5.6MB
==> Installing postgresql dependency: readline
==> Pouring readline-8.1.2.arm64_monterey.bottle.tar.gz
/opt/homebrew/Cellar/readline/8.1.2: 48 files, 1.7MB
==> Installing postgresql
==> Pouring postgresql-14.2_1.arm64_monterey.bottle.tar.gz
==> /opt/homebrew/Cellar/postgresql/14.2_1/bin/initdb --locale=C -E UTF-8 /opt/h
==> Caveats
To migrate existing data from a previous major version of PostgreSQL run:
brew postgresql-upgrade-database
This formula has created a default database cluster with:
initdb --locale=C -E UTF-8 /opt/homebrew/var/postgres
For more details, read:
https://www.postgresql.org/docs/14/app-initdb.html
To restart postgresql after an upgrade:
brew services restart postgresql
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/postgresql/bin/postgres -D /opt/homebrew/var/postgres
==> Summary
/opt/homebrew/Cellar/postgresql/14.2_1: 3,305 files, 44.9MB
==> Running `brew cleanup postgresql`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> postgresql
To migrate existing data from a previous major version of PostgreSQL run:
brew postgresql-upgrade-database
This formula has created a default database cluster with:
initdb --locale=C -E UTF-8 /opt/homebrew/var/postgres
For more details, read:
https://www.postgresql.org/docs/14/app-initdb.html
To restart postgresql after an upgrade:
brew services restart postgresql
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/postgresql/bin/postgres -D /opt/homebrew/var/postgres