I have a standard homebrew install inside of usr/local/
When I try:
Larson-2:~ larson$ brew install postgresql Error: Cannot write to /usr/local/Cell
This also happens if you have multiple users on your machine. If so, it would be best for you to change the user since every other approach would have you messing around with a lot more files and folders than just /usr/local/Cellar
Use su userWhoInstalledBrew.
su userWhoInstalledBrew