I was able to solve the problem by using chown on the folder:
sudo chown -R "$USER":admin /usr/local
Also you‘ll (most probably) have to do the same on /Library/Caches/Homebrew:
sudo chown -R "$USER":admin /Library/Caches/HomebrewHow to fix homebrew permissions?
原文:http://www.cnblogs.com/iosblogx/p/6388013.html