LoginSignup
1
4

More than 5 years have passed since last update.

macOS MojaveでHomebrewのdoctorしたらWarning: The following directories do not exist:となったときの対応方法

Posted at

事象 : brew doctorしたらWarning: The following directories do not exist:となった

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

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

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

原因 : ディレクトリがないから

$ ls -l /usr/local/
total 0
drwxrwxr-x    4 mana  admin   128 11  9 12:33 Caskroom
drwxr-xr-x   57 mana  admin  1824 11  9 12:33 Cellar
drwxr-xr-x   21 mana  admin   672 12 11 00:09 Homebrew
drwxrwxr-x  211 mana  admin  6752 11  9 12:33 bin
drwxr-xr-x   13 mana  admin   416 11  9 12:33 etc
drwxr-xr-x   78 mana  admin  2496 11  9 12:33 include
drwxr-xr-x  264 mana  admin  8448 11  9 12:33 lib
drwxr-xr-x   68 mana  admin  2176 11  9 12:33 opt
drwxr-xr-x   14 mana  admin   448 11  9 12:33 packager
drwxr-xr-x    4 mana  admin   128 11  9 12:32 rbenv
drwxr-xr-x    3 mana  wheel    96 11  9 12:32 remotedesktop
drwxr-xr-x   20 mana  admin   640 11  9 12:33 share
drwxr-xr-x   11 mana  admin   352 11  9 12:33 var

対応方法 : brew updateしてからディレクトリを作る

$ brew update
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
<省略>

# なぜかupdateしたら/usr/local/Frameworksはいらなくなる・・・・
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don`t worry or file an issue; just ignore this. Thanks!

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

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

# doctorに言われた通りにディレクトリを作って権限を付与する
$ sudo mkdir -p /usr/local/sbin
Password:
$ sudo chown -R $(whoami) /usr/local/sbin
$ ls -l /usr/local/
total 0
drwxrwxr-x    4 mana  admin   128 11  9 12:33 Caskroom
drwxr-xr-x   57 mana  admin  1824 11  9 12:33 Cellar
drwxr-xr-x   21 mana  admin   672 12 11 00:09 Homebrew
drwxrwxr-x  211 mana  admin  6752 11  9 12:33 bin
drwxr-xr-x   13 mana  admin   416 11  9 12:33 etc
drwxr-xr-x   78 mana  admin  2496 11  9 12:33 include
drwxr-xr-x  264 mana  admin  8448 11  9 12:33 lib
drwxr-xr-x   68 mana  admin  2176 11  9 12:33 opt
drwxr-xr-x   14 mana  admin   448 11  9 12:33 packager
drwxr-xr-x    4 mana  admin   128 11  9 12:32 rbenv
drwxr-xr-x    3 mana  wheel    96 11  9 12:32 remotedesktop
drwxr-xr-x    2 mana  wheel    64 12 11 00:27 sbin
drwxr-xr-x   20 mana  admin   640 11  9 12:33 share
drwxr-xr-x   11 mana  admin   352 11  9 12:33 var

$ brew doctor
Your system is ready to brew.
1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4