Very easy Groovy and Grails installation on OS X (through MacPorts)
Thursday, December 31, 2009 at 4:52PM I’ve had a lot of trouble with MacPorts in the past, so I’m typically reluctant to go that route for Unix tool installation on my OS X machine, however, installing Groovy and Grails proved very easy with MacPorts.
You must first install MacPorts.
Once MacPorts is installed (instructions), you:
- Open a terminal (In Finder double-click Utilities->Terminal).
- Type sudo port install groovy (you will be prompted for your password)
- Once installation is complete type groovy -v to confirm that the installation was successful.
- Type sudo port install grails
- Once installation is complete you must set the GRAILS_HOME variable. Ensure you are in your Home directory (type cd ~), then type vim .profile. This will open the VImproved editor (it’s a wonky but handy editor). Press the down arrow until you are at the bottom of the screen, then type i to change to “insert” mode. Once in insert mode copy this to your clipboard: export GRAILS_HOME=/opt/local/share/java/grails. Then press CRTL+V to paste to the bottom of the file. Save the file and exit by typing ESC wq.
- Type grails -v to confirm that the installation was successful.
That should do the trick!

