Homebrew error on Mojave
➜ ~ brew upgrade imagemagick
Updating Homebrew…
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.==> Upgrading 1 outdated package, with result:
imagemagick 7.0.8–0 -> 7.0.8–6
==> Upgrading imagemagick
Error: The Command Line Tools header package must be installed on Mojave.
The installer is located at:
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Solution
Install .pkg file which the Terminal mentioned manually
$ cd /Library/Developer/CommandLineTools/Packages/
$ open .
Then, click “macOS_SDK_headers_for_macOS_10.14.pkg”.
This step will take a couple of minutes. Then you can start using brew upgrade command.