mac 安裝homobrew 報錯解決

mac升級到10.14.1版本安裝homobrew報錯

按照官網(wǎng)給的命令:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

執(zhí)行后 報錯:

xcode-select: error: invalid developer directory'/Library/Developer/CommandLineTools'
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch/Library/Developer/CommandLineTools

解決方法:

1.執(zhí)行:xcode-select -p找到真正的路徑
輸出/Applications/Xcode.app/Contents/Developer即 xcode-select的有效路徑

2.使用有效路徑:/Applications/Xcode.app/Contents/Developer 替換 文件地址 中的 /Library/Developer/CommandLineTools

  • 先將內(nèi)容復制到一個空白文件中
  • 將最后兩處的/Library/Developer/CommandLineTools 改為/Applications/Xcode.app/Contents/Developer
  • 最后保存為名為 install的文件

3.進入保存的install文件目錄下,執(zhí)行 ruby -e "$(cat install)"即可

附上修改后的install文件 點擊下載 提取碼: cidv

?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容