I tried many things but didn't work. So what you can do, go to Homebrew Github Repository and there you'll see .pkg installer provided to each release. Simply download that file and you are good to go.
Here's the link to download the .pkg file.