Homebrew install fails while copying files
I could get it working with
sudo chown -R $USER /usr/local
thanks to @joran for suggesting this in comments
You are getting permission denied when downloading the files into /usr/local
.
This folder often belongs to root. This is a known issue with brew. Fix it by doing
sudo chown -R $(whoami) $(brew --prefix)/*
and then re-run the installer.