emjayess
7/10/2013 - 3:55 PM

Managing Grails versions using homebrew package manager for Mac OS X

Managing Grails versions using homebrew package manager for Mac OS X

# now the system is ready to switch to and use the desired version

brew switch grails 2.0.0
## Cleaning /usr/local/Cellar/grails/2.0.1
## Cleaning /usr/local/Cellar/grails/2.2.2
## 3 links created for /usr/local/Cellar/grails/2.0.1
# if a grails version is already installed

# present?
which grails
## /usr/local/bin/grails

# which version?
brew info grails
## grails: stable 2.2.2
## http://grails.org
## /usr/local/Cellar/grails/2.2.2 (2131 files, 146M) *
##   Built from source
##  https://github.com/mxcl/homebrew/commits/master/Library/Formula/grails.rb
## ...

# unlink the installed/active version (not necessary to brew remove)
brew unlink grails
## Unlinking /usr/local/Cellar/grails/2.2.2... 3 links removed
# find the versions available in homebrew

# optionally
brew up
## ... homebrew refreshes all package information

brew versions grails
## 2.2.2    git checkout a3fdc1f /usr/local/Library/Formula/grails.rb
## 2.2.1    git checkout aa5c440 /usr/local/Library/Formula/grails.rb
## 2.2.0    git checkout 5c5b964 /usr/local/Library/Formula/grails.rb
## 2.1.3    git checkout d08ef78 /usr/local/Library/Formula/grails.rb
## 2.1.2    git checkout f038344 /usr/local/Library/Formula/grails.rb
## 2.1.1    git checkout 1bcf5af /usr/local/Library/Formula/grails.rb
## 2.1.0    git checkout 0dcf6e7 /usr/local/Library/Formula/grails.rb
## 2.0.4    git checkout 624e065 /usr/local/Library/Formula/grails.rb
## 2.0.3    git checkout af73ab0 /usr/local/Library/Formula/grails.rb
## 2.0.2    git checkout 1015eda /usr/local/Library/Formula/grails.rb
## 2.0.1    git checkout 97e8e5a /usr/local/Library/Formula/grails.rb
## 2.0.0    git checkout 8c2394b /usr/local/Library/Formula/grails.rb
## 1.3.7    git checkout 232acd0 /usr/local/Library/Formula/grails.rb
## 1.3.6    git checkout 99b3ce9 /usr/local/Library/Formula/grails.rb
## 1.3.5    git checkout 9ae2ee6 /usr/local/Library/Formula/grails.rb
## 1.3.4    git checkout 9f1d66f /usr/local/Library/Formula/grails.rb
## 1.3.3    git checkout 590ae42 /usr/local/Library/Formula/grails.rb
## 1.3.2    git checkout 83f1377 /usr/local/Library/Formula/grails.rb
## 1.3.1    git checkout 0005a71 /usr/local/Library/Formula/grails.rb
## 1.3.0    git checkout f257bf9 /usr/local/Library/Formula/grails.rb
## 1.2.2    git checkout 585ee08 /usr/local/Library/Formula/grails.rb
## 1.2.1    git checkout e4b66ce /usr/local/Library/Formula/grails.rb

# copy/paste the git command for the desired version; e.g. 2.0.1
git checkout 97e8e5a /usr/local/Library/Formula/grails.rb

# then install
brew install grails
## ==> Downloading http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.0.1.zip
## ######################################################################## 100.0%
## ...