I ran brew update
and got
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': Failed to connect to 10.8.0.1 port 8080: Operation timed out
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
So I sometimes use a network which has proxy, so I added the following lines to .bash_profile (apart from usual changes in network settings via system preferences):
export http_proxy="http://10.8.0.1:8080"
export https_proxy="https://10.8.0.1:8080"
So I thought this might be causing the problem and commented these lines out, used source .bash_profile, rebooted and used cellular network. Still the same error.
First remove the proxy, if you are using any proxy. I had the same problem.
In your terminal try running brew update-reset
and then source ~/.bash_profile