rubymacoshomebrewmacos-catalina

How to fix Homebrew install failing with "Error: Failed to install Homebrew Portable Ruby"


Here's some info:

When running the install command on the Homebrew page I get the following error:

==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz
################################################                                                                                                                                                           24.1%
curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
Error: Checksum mismatch.
Expected: b065e5e3783954f3e65d8d3a6377ca51649bfcfa21b356b0dd70490f74c6bd86
  Actual: be732ceabd97bbe69929621075c00c2e1709e30b8ab9a9ba3b7064a14ad6bbff
 Archive: /Users/e113991/Library/Caches/Homebrew/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install Homebrew Portable Ruby (and your system version is too old)!
Failed during: /usr/local/bin/brew update --force --quiet

Running brew doctor reminds me:

Error: Failed to install Homebrew Portable Ruby (and your system version is too old)!

Notice it is installing Yosemite, not Catalina. Why? I tried to use git clone to copy it to my usr/local directory but I don't have write privileges to that. I tried every other solution on Stack Overflow to no avail.


Solution

  • I ran into the same problem when trying to install on my Macbook (Mojave 10.14.6 XCode 11.3 CLT 11.3).

    For me, it turned out that access to the internet for brew was blocked without notice by a firewall in the background. Simply adding a rule did the trick.