Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

事象 : 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.
ponsuke0531
びっくりするほど物覚えが悪いが、エンジニアを目指しています。
http://ponsuke-tarou.hatenablog.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away