[英]cannot install homebrew on macos sierra
I am running this command: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )" 我正在运行此命令:/ usr / bin / ruby -e“$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )”
and I'm get hte error: 我得到了错误:
HEAD is now at 79e8cdd Merge pull request #1253 from jawshooah/perf/relocate-text-files
/usr/local/bin/brew: /usr/local/bin/readlink: /bin/bash: bad interpreter: Operation not permitted
/usr/local/bin/brew: /usr/local/bin/readlink: /bin/bash: bad interpreter: Operation not permitted
/usr/local/bin/brew: line 47: /usr/local/Library/Homebrew/brew.sh: No such file or directory
Failed during: /usr/local/bin/brew update --force
It's maybe related to filesystem metadata (quarantine attribute), run: 它可能与文件系统元数据(隔离属性)有关,运行:
ls -l /usr/local/bin
If you see a @
character on some lines such as in -rwxr-xr-x@
, you can remove the filesystem metadata with : 如果在
-rwxr-xr-x@
等某些行上看到@
字符,则可以使用以下命令删除文件系统元数据:
xattr -d com.apple.quarantine /usr/local/bin/readlink
Read this question for more information : Mac OS: /usr/bin/env: bad interpreter: Operation not permitted 阅读此问题以获取更多信息: Mac OS:/ usr / bin / env:错误的解释器:不允许操作
Just because I came across this answer in my search for how to fix this problem, and the accepted answer didn't work for me, I figured I would post my solution. 仅仅因为我在寻找如何解决这个问题时遇到了这个答案,并且接受的答案对我不起作用,我想我会发布我的解决方案。 After reinstalling brew a million different ways (which had issues due to the readlink problem), reinstalling ruby, xcode-tools, and every other piece of software on the planet, I had the "duhh" moment of trying to see what was wrong with
readlink
itself. 在重新安装了一百万种不同的方法(由于readlink问题导致问题),重新安装ruby,xcode-tools以及地球上的所有其他软件之后,我有一个“duhh”时刻试图查看出现了什么问题。
readlink
本身。
In the end, this is how I fixed it: 最后,这是我修复它的方式:
cd /usr/local/bin
rm readlink
realpath
(or whatever you want) with this content realpath
(或任何您想要的)的文件 here: 这里:
#!/usr/bin/env python
import os,sys
print os.path.realpath(sys.argv[1])
chmod +x realpath
ln -s realpath readlink
The above instructions can be found here. 以上说明可在此处找到。 Essentially we're just replacing whatever
readlink
they had implemented originally with Python's implementation of the functionality, their os.path.realpath
function. 基本上我们只是用Python的功能实现,
os.path.realpath
函数替换他们最初实现的任何readlink
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.