错误信息如下:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out
admindeMac-mini:~ conan$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The Xcode Command Line Tools will be installed.
Press RETURN to continue or any other key to abort
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
Password:
==> Installing Command Line Tools (macOS Mojave version 10.14) for Xcode-10.2
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (macOS\ Mojave\ version\ 10.14)\ for\ Xcode-10.2
Software Update Tool
Error downloading Command Line Tools (macOS Mojave version 10.14) for Xcode: 未能验证该更新。
Done.
Error downloading updates.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
解决方法 「参考原文地址:https://www.v2ex.com/t/461794」
今天打开我刚升 10.14 的 Macbook 懵逼地发现运行 git 报错了,网上查了一下是 Xcode Command Line Tool 缺失的原因,但是 `xcode-select --install` 没用,因为在苹果还没把 beta 版的放在更新服务器上。然而网上并没有太多 10.14 安装 CLT 的资料,只有直接安装 5g 多的 Xcode 10 的方法...
不过最后在苹果的开发者下载中心找到了 CLT 的 dmg,在 [https://developer.apple.com/download/more/](https://developer.apple.com/download/more/) 里面,用免费开发者账户登陆就可以,然后就可以在列表里找到 Command Line Tools (macOS 10.14) for Xcode 10 Beta 下载了。
当然为了方便大家,我把 dmg 放到了 Onedrive 上,Release Date 是 June 4, 2018。
链接不会更新而且随时可能失效,同时可能又一定风险,请尽量从官网下载。
不过我想过一段时间苹果应该就会直接推送了吧。
链接: [https://campuen-my.sharepoint.com/:u:/g/personal/fz5178_my365_ink/EXK1Xz3ZgeVNmPvPfFYv8GIB5KCAI-fGlQLFPluMkWMh2g?e=nhGOU7](https://campuen-my.sharepoint.com/:u:/g/personal/fz5178_my365_ink/EXK1Xz3ZgeVNmPvPfFYv8GIB5KCAI-fGlQLFPluMkWMh2g?e=nhGOU7)