Newest version of HomeBrew, versions no longer supported
brew tap homebrew/versions


then:

brew install homebrew/versions/grails23


brew search grails will show you all the available ones to install.