macOS Mojaveにするとbrew doctorでWarningの対処

Warningを解消

macOSをMojaveにアップグレードしたのでHomebrewをアップデート(brew update)してから状態を確認(brew doctor)するとWarningが出ました。

Warning: The following directories do not exist:
/usr/local/include
/usr/local/lib
/usr/local/sbin

これらのディレクトリがないということで、以下のように指示が表示されます。

You should create these directories and change their ownership to your account.
  sudo mkdir -p /usr/local/include /usr/local/lib /usr/local/sbin
  sudo chown -R $(whoami) /usr/local/include /usr/local/lib /usr/local/sbin

この通りディレクトリを作成するとWarningはなくなりました。

ついでに、他のWarningも出たので参考のため掲載しておきます。

Homebrew以外でインストールしたもののconfigスクリプトに関するWarningです。

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/birdy/.pyenv/shims/python2-config
  /Users/birdy/.pyenv/shims/icu-config
  /Users/birdy/.pyenv/shims/libpng16-config
  /Users/birdy/.pyenv/shims/python3.6m-config
  /Users/birdy/.pyenv/shims/python2.7-config
  /Users/birdy/.pyenv/shims/python-config
  /Users/birdy/.pyenv/shims/python3-config
  /Users/birdy/.pyenv/shims/ncursesw6-config
  /Users/birdy/.pyenv/shims/pcre-config
  /Users/birdy/.pyenv/shims/python3.6-config

HomebrewからpyenvをインストールしてもこのWarningが出るのですね。今更ですが今気づきました。

これは.bash_profileにaliasを追加することで解消します。

$ echo 'alias brew="env PATH=${PATH/\/Users\/user\/\.pyenv\/shims:/} brew"' >> .bash_profile

シェアする