Failed to install Homebrew Portable Ruby (and your system version is too old)
Solution 1:
I had the same question, and the solution is simple: remove the portable-ruby-2.6.3.mavericks.bottle.tar.gz
you downloaded before.
rm /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Solution 2:
Try running brew update-reset
in your terminal and then run brew upgrade
in the same terminal.
Solution 3:
"Homebrew install fails with Error: Failed to install Homebrew Portable Ruby" helped me tremendously.
It would fail to install, because our company firewall was blocking certain downloads, like bottle, during the Homebrew update/install, but it was difficult to determine this because I would get the error above.
After removing the file, try
brew upgrade
brew update
on your personal Wifi or your phone's hotspot.
Solution 4:
I fixed it.
First, I deleted the brew file that stores in the Library folder when using macOS.
The failure before was due to the connection. When I make sure the connection worked, it worked.