mac升级到10.14.1版本安装homobrew报错
按照官网给的命令:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
执行后 报错:
xcode-select: error: invalid developer directory'/Library/Developer/CommandLineTools'
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch/Library/Developer/CommandLineTools
解决方法:
1.执行:xcode-select -p
找到真正的路径
输出/Applications/Xcode.app/Contents/Developer
即 xcode-select的有效路径
2.使用有效路径:/Applications/Xcode.app/Contents/Developer
替换 文件地址 中的 /Library/Developer/CommandLineTools
- 先将内容复制到一个空白文件中
- 将最后两处的
/Library/Developer/CommandLineTools
改为/Applications/Xcode.app/Contents/Developer
- 最后保存为名为
install
的文件
3.进入保存的install
文件目录下,执行 ruby -e "$(cat install)"
即可
附上修改后的install
文件 点击下载 提取码: cidv
网友评论