Chris, I was working off the instructions in the wiki. I looked at the loch folder created by Homebrew and there was a file called MacOS which appeared to be an executable. I suspected it should have been a folder so I deleted it and created the folder myself and re-ran brew. This time it worked fine. I suspect there is something wrong with the script in Homebrew but I don't know anything about that.