【问题标题】:Mac `zsh: command not found: psql`Mac`zsh:找不到命令:psql`
【发布时间】:2021-12-20 13:35:19
【问题描述】:

我已经像这样添加了.bash_profile的路径。

#psql
export "PATH=/Applications/Postgres.app/Contents/Versions/14/bin:$PATH"

在我运行source .bash_profile 之后,我成功运行了psql。

问题是当我关闭终端并重新打开它时,psql 不起作用。我必须再次source .bash_profile。我该如何解决?

【问题讨论】:

    标签: bash macos psql


    【解决方案1】:

    那是因为您正在编辑.bash_profile 并使用zsh。

    如果您要解决问题,请编辑.zshrc。或者,您也可以编辑.profile,当您同时使用bash 和zsh 或您选择的任何其他shell 时,它将起作用。

    【讨论】:

    • 编辑.zshrc 有效,但编辑.profile 无效。谢谢
    • 对不起,对于zsh,您可以编辑.zprofile,或者您可以简单地这样做; emulate sh -c '. ~/.profile'。上述命令使.profile 编辑工作。你可以参考这篇文章,superuser.com/a/187673
    猜你喜欢
    • 2016-07-09
    • 1970-01-01
    • 1970-01-01
    • 2021-11-08
    • 2021-06-19
    • 2017-08-13
    • 2021-04-30
    • 1970-01-01
    • 2023-02-07
    相关资源
    最近更新 更多