This worked for me.
run brew doctor
Warning: Some taps are not on the default git origin branch and may
not receive updates. If this is a surprise to you, check out the
default branch with: git -C $(brew –repo homebrew/core) checkout
master
then run git -C $(brew --repo homebrew/core)