I a big fan of homebrew. I have been using it for a while now and i am like a lot. But i recent hit a big headache with permission issue with another account on my Mac.
I installed homebrew using a previous user account, but this proved to be very unforgiving to install software from the new user account.
brew install redis Error: Cannot write to /usr/local/Cellar
The following steps will enable the new user and/or other users to install software with homebrew. BTW thanks for Geoff Low (glow) for helping out.
Firstly set the umask for the user. (inside the .bashrc or .profile or .bash_profile)
umask 0002 # grant write permission to group
For more on umask.
then recursively grant group write permission to /usr/local directory:
sudo chmod -R g+w /usr/local/
then also change recursively /usr/local group to staff:
sudo chgrp -R staff /usr/local
Alright thats it you should be good to go now with the new user account installing software with homebrew.
Be sure to run and follow any further instructions:
brew doctor
NB: It is worthy to note that homebrew by design requires that in your user profile file (i.e. .bashrc or .profile or .bash_profile), that your set /usr/local/bin ahead of /usr/bin to avoid clashes with system software tools that may exist in other paths on your machine. it is important that you override the system paths to use homebrew installations as default.