mac 安装homobrew 报错解决

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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容