Having just bought a new Mac Book I thought I would document the steps for installing Groovy and Grails.
Go to http://groovy.codehaus.org/Downloadand download Groovy (Version 1.5.7). The Tutorial 1 - Getting Started is a help but as a newcomer to Mac OS-X I found the installation instructions more than a bit vague.
Download the zipped Binary Release and copy the resulting folder (mine was called groovy-1.5.7) to your target folder. I stored mine in the Library folder (under Macintosh HD). This is where the Java folder resides, so it seemed a reasonable place to store it.
While we are here, we might as well do the same for Grails via the http://grails.org/Download download website and download the Binary ZIP. Move the resulting folder (grails-1.0.3) to the Library folder.
The Getting Started instructions tell you to Create a GRAILS_HOME environment variable that points to the path where you extracted the archive. On the Apple this is in a file called profile which is found in the etc folder.
In the Textmate ‘open file’ dialog box (tick the Show Hidden Files checkbox) and edit /etc/profile to include the following:
By opening the terminal window (Applications/Utilities/Terminal) and typing groovysh you can check that Groovy was installed properly.
Then type grails to check that grails is installed. This gave me a -bash: /Library/grails-1.0.3/bin/grails: Permission denied error. Run the command chmod +x /Library/grails-1.0.3/bin/grails - to fix this problem (I am not sure what this does but I found the solution somewhere on the web).