尝试在Homebrew上运行postgresql时出现拒绝权限错误



我运行了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不太熟悉,想知道如何解决这个问题。谢谢

我正在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

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

% 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

最新更新