Macos – Brew doctor says: “Warning: /usr/local/include isn’t writable.”

homebrewmacos

Brew doctor says:

Warning: /usr/local/include isn't writable. This can happen if you "sudo make install" software that isn't managed by Homebrew.

If a brew tries to write a header file to this directory, the install
will fail during the link step.

You should probably chown /usr/local/include

I've tried different commands to solve this but I'm still stuck here.

I'm running homebrew on 10.8.2

Best Answer

Take ownership of it and everything in it.

Mac OS High Sierra or newer: (ty to Kirk in the comments below)

$ sudo chown -R $(whoami) $(brew --prefix)/*

Previous versions of macos:

$ sudo chown -R $USER:admin /usr/local/include

Then do another

$ brew doctor