尝试启动通过 Homebrew 安装的 PostgreSQL 时出错:“不允许操作”

And*_*rew 25 postgresql macos

我最近通过Homebrew在我的 Mac 上安装了 PostgreSQL 。(我可能已经安装了它;它没有运行。)

brew install postgres
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
Run Code Online (Sandbox Code Playgroud)

现在我试图用它开始launchctl

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Run Code Online (Sandbox Code Playgroud)

...但我收到一个错误:

/usr/local/Cellar/postgresql/9.4.0/homebrew.mxcl.postgresql.plist:不允许操作

这个错误是什么意思?我究竟做错了什么?我该如何解决这个问题?

Nei*_*eil 84

可能是您在TmuxScreenlaunchctl内部使用。

Tmux 和 Screen 是终端多路复用器,它们产生多个“屏幕”,您可以在单个终端中轻松切换。

由于某种我不知道的原因,launchctl在 Tmux 内运行永远不会工作,并发出错误Operation not permitted。在普通 shell 中运行它,它可能会正常工作。

  • 对此的解决方案是使用这里提到的 reattach-to-user-session:http://apple.stackexchange.com/questions/41412/using-tmux-and-pbpaste-pbcopy-and-launchctl 在您的 .tmux 中。配置文件 (2认同)