Brew error on macOS High Sierra: Check you have permission to write to /usr/local

You just have to uninstall and reinstall Brew on your Mac:

brew bundle dump

And then:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Fixed!

--

--