Brew 升级更新错误"Failed to install vendor Ruby."

5,106 阅读1分钟
JK:SMail aici$ brew update 
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 
fatal: unable to access 'https://github.com/Homebrew/homebrew-cask/':LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 
Error: Fetching/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed! Fetching
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed! ==> Downloading
https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby--2.6.3.mavericks.bottle.tar.gz 
Already downloaded: /Users/aici/Library/Caches/Homebrew/portable-ruby--2.6.3.mavericks.bottle.tar.gz 
Error: Checksum mismatch. Expected: ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104 Actual:f6e315e67716e0bd3e1f35157bb6b362c2bed7eaf417616e8662ae3db32440bf Archive:/Users/aici/Library/Caches/Homebrew/portable-ruby--2.6.3.mavericks.bottle.tar.gz To retry an incomplete
download, remove the file above. Error: Failed to install vendor Ruby.

背景

最近更新软件库的时候发现使用 `brew update` 命令报了上面的错误,具体导致原因猜测是因为墙的因素导致ruby的安装包下载不完全然后系统没有删除机制所以一直卡在那儿并报错。

解决方案

删除`Archive:`后面路径下的文件
rm -rf /Users/aici/Library/Caches/Homebrew/portable-ruby--2.6.3.mavericks.bottle.tar.gz
然后再重新使用 brew update 命令
如果还是不行考虑下搭一个全局梯子