lawn-128-61-59-74:~ postgres$ createuser -R -P -S -D fhir
运行“brew install postgresql”并运行postgres后,运行上面的命令时出现以下错误:
“-bash:createuser:command not found”
跑:
sudo find / -name createuser
这可能意味着Postgres不在你的PATH
。
由于您使用Homebrew安装,因此您的PATH
应包括
Applications/Postgres.app/Contents/Versions/9.6/bin
您可以将此行添加到.bash_profile
以解决此问题
export PATH="Applications/Postres.app/Contents/Versions/9.6/bin:$PATH"
(注意:9.6
是版本 - 这可能与您不同。)
如果您没有使用brew
安装Postgres,您可以使用Vao Tsun的answer找到Postgres在您机器上的位置,并将其添加到您的路径中