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