Do this once
sudo dseditgroup -o create brew
Create a brew groupsudo dseditgroup -o edit -a USER1 -t user brew
Add first usersudo dseditgroup -o edit -a USER2 -t user brew
Add second user
This might need to be repeated on occasion
brew doctor
Check to see how wrong things aresudo chgrp -R brew $(brew --prefix)/*
Change the group of homebrew installation directorysudo chmod -R g+w $(brew --prefix)/*
Allow group members to write inside this directorybrew doctor
Check to see how correct things are
If the error below appears when running brew upgrade
, change the ownership and permissions with the commands further down
Error: Permission denied @ rb_sysopen - /usr/local/var/homebrew/locks/[email protected]
sudo chgrp -R brew /usr/local/var/homebrew/*
sudo chmod -R g+w /usr/local/var/homebrew/*