Macos 试图通过自制为Appium安装移动设备驱动程序时,Mac上出现Chown故障

Macos 试图通过自制为Appium安装移动设备驱动程序时,Mac上出现Chown故障,macos,permissions,appium,homebrew,chown,Macos,Permissions,Appium,Homebrew,Chown,Appium无法识别uid后,我尝试使用以下命令安装它: brew install libimobiledevice --HEAD 这给了我以下错误: Error: /usr/local/Homebrew is not writable. You should change the ownership and permissions of /usr/local/Homebrew back to your user account: sudo chown -R $(whoami) /usr/lo

Appium无法识别uid后,我尝试使用以下命令安装它:

brew install libimobiledevice --HEAD
这给了我以下错误:

Error: /usr/local/Homebrew is not writable. You should change the
ownership and permissions of /usr/local/Homebrew back to your
user account:
sudo chown -R $(whoami) /usr/local/Homebrew
Error: Permission denied @ rb_sysopen - > 
/usr/local/var/homebrew/locks/libimobiledevice.formula.lock
所以,我复制了Pastad并运行了chown命令。它没有抱怨,似乎在运行。但是,当我再次运行第一个命令时,仍然会收到相同的错误消息

有人能帮我解决这个问题吗

编辑: 我运行了以下命令: ls-ld/usr/local/Homebrew

这就是输出: drwxr-xr-x 17 1791192515 wheel 544 Mar 2 12:08/usr/local/Homebrew

我运行了以下命令: ls-l/usr/local/var/homebrew/locks/libimobiledevice.formula.lock

这就是输出:
没有这样的文件或目录

这些是我为解决这个问题而采取的步骤

sudo chown-R$用户:admin/usr/local 然后: sudo chown-R$用户:管理员/库/缓存/自制 然后: /usr/bin/ruby-e$curl-fsSL 在再次尝试运行之前:
brew install libimobiledevice-HEAD

除了所有权之外,还有其他原因导致Homebrew无法写入。请使用ls-ld/usr/local/Homebrew和ls-l/usr/local/var/Homebrew/locks/libimobiledevice.formula.lock,这样我们就可以查看perms了。我运行了这些。第二个目录似乎不存在。我怎样才能得到它?