$ brew install fontconfig
Error: Permission denied - /Library/Caches/Homebrew/Formula/fontconfig.brewing
$ sudo chown -R `whoami` /usr/local
$ brew install fontconfig
Error: Permission denied - /Library/Caches/Homebrew/Formula/fontconfig.brewing
Not sure where to go from here. Ran brew doctor to fix some existing issues, but can't seem to get past this.
trojanfoe's answer helped. There was a permission issue with the Library/Logs folder that I wasn't assigned to, but somehow the Library/Caches/Homebrew folder didn't exist. So I just created that, the subfolder Formula, and changed the permission and everything installed just fine. It actually cleared up a lot of errors I was having.
Thanks everyone.
Update
@fet's one liner works great.
For others that are running into the error of something like
Make sure that your directory, in this case
/usr/local/lib
, has sufficient permissions for you to access it. I ran into the issue where it was only assigned toroot:admin
.Switched that to
myusername:admin
and was able to upgrade with no problems.Hope that helps!