【问题标题】:Permission denied error when trying to run postgresql on Homebrew尝试在 Homebrew 上运行 postgresql 时出现权限被拒绝错误
【发布时间】:2020-07-09 01:26:55
【问题描述】:

我跑了brew install postgresql

  1. 然后brew services start postgresql

收到 Error: Permission denied @ apply2files - /Users/$USER/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

  1. chmod 755 ~/Library/LaunchAgentscp /usr/local/opt/postgresql/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/(来自https://coreyward.svbtle.com/fixing-homebrew-postgres-installation-on-macos-catalina

这给了我Error: Permission denied @ rb_sysopen - /Users/$USER/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

  1. 我从这个线程 https://gist.github.com/irazasyed/7732946 尝试了各种方法,但没有成功。

我对 Homebrew 不太熟悉,想知道如何解决这个问题。谢谢!

【问题讨论】:

    标签: postgresql homebrew


    【解决方案1】:

    我在 Macbook Air m1 上运行。

    我跑的时候:

    brew services start postgresql
    

    我收到以下错误:

    Error: Permission denied @ rb_sysopen - /Users/<username>/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
    

    我没有做你发布的事情,而是做了以下事情:

    sudo chown <username> /Users/<username>/Library/LaunchAgents/
    

    这使它起作用了。 我从这个 github 线程中得到了这个想法:https://github.com/Homebrew/homebrew-services/issues/177#issuecomment-450432567

    【讨论】:

      【解决方案2】:

      你可以运行这两个命令,它对我有用。

      % chmod 755 ~/Library/LaunchAgents
      % cp /usr/local/opt/postgresql/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
      

      要了解更多关于正在发生的事情,您可以查看以下链接: 来源:https://coreyward.svbtle.com/fixing-homebrew-postgres-installation-on-macos-catalina

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-06-09
        • 2012-02-21
        • 2021-07-12
        • 2015-06-08
        • 2019-01-30
        • 2019-04-28
        • 1970-01-01
        相关资源
        最近更新 更多