ここ半年、HomebrewでPHPを更新しようとして、「brew search php@7」としても、
Error: No formulae or casks found for "php@7".
この辺りのエラーが出て、PHPが更新できない状態だった。あんまりこの辺り詳しくなかったんだけど、検索しても原因がわからず、放置案件にしてたんだけど、別件で調べものしてる時に解決法発見!
何気に「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
updates. If this is a surprise to you, check out the default branch with:
git -C $(brew --repo homebrew/core) checkout master
というWarning を発見。前回も「brew doctor」は、やってみたんだけど、気づかなかった。なので、ターミナルに
git -C $(brew --repo homebrew/core) checkout master
をコピペして、エンター!して、再度「brew search php@7」を実行すると、
==> Formulae
php@7.2 php@7.3 php@7.4
php@7.2 php@7.3 php@7.4
これで更新できます!