I ran brew outdated
在 macOS Mojave 10.14.2 中并确定python
and python@2
已经过时了。当我跑的时候brew upgrade
两者都失败了。例如对于python@2
:
==> Upgrading python@2
==> Downloading https://homebrew.bintray.com/bottles/[email protected] /cdn-cgi/l/email-protection_2.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring [email protected] /cdn-cgi/l/email-protection_2.mojave.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
I ran brew doctor
它建议brew link
但这仍然失败并出现相同的权限错误:
Linking /usr/local/Cellar/python@2/2.7.15_2... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
这个帖子 https://stackoverflow.com/questions/20514084/how-to-fix-brew-doctor-errors-on-mac-osx-10-9-unlinked-kegs-in-cellar-and-hom建议给父目录授予权限,但是我想了解为什么会出现这种情况,并找到解决方案供学习。
我找到了答案here https://github.com/Homebrew/brew/issues/3228。我不得不sudo mkdir /usr/local/Frameworks
首先创建丢失的目录,然后sudo chown -R $(whoami) $(brew --prefix)/*
since sudo chown -R $(whoami) /usr/local
据该帖子称,在此之前不再适用于莫哈韦和高山脉。我以前可以brew link python
and brew link python@2
在那之后。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)