owned mediaウェブ制作に役立つコンテンツを発信中!

brew doctorでWarningが出た時にする対処方法のメモ

最終更新日: Update!!
先日Homebrewでインストールをすることがあったので、アップデートと合わせてHomebrewの状態をdoctorコマンドしてみたところWarningがいくつか出てきたので対処方法を備忘録として残しておきました。   パス末尾のスラッシュ
Warning: Some directories in your path end in a slash.
Directories in your path should not end in a slash. This can break other
doctor checks. The following directories should be edited:
  パスがスラッシュで終わっていることが原因のようで、該当するものでパスの末尾がスラッシュになっている部分を削除して修正します。   configファイルの存在
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:
  該当するconfigファイルがbrew実行時に競合する恐れがあるという警告とのこと、brew実行時のみ該当するパスを除外させるため、.bashrcに下記のような形でエイリアスを記述します。 【.bashrc】
########## /Applications/MAMP/bin/php/php7.0.15/bin/php-config の場合 ##########

alias brew="env PATH=${PATH/\/Applications\/MAMP\/\bin\/\php\/\php7.0.15\/bin:/} brew"
    /usr/local/sbinが無い
Warning: The following directories do not exist:
/usr/local/sbin
  OSをアップデートしたら起こるようになりました。新たに生成する必要があるとのことです。エラー表示の直後に下記のコマンドが案内されていたので、そのまま実行します。
sudo mkdir -p /usr/local/sbin
sudo chown -R $(whoami) /usr/local/sbin
    シンボリックリンクが壊れている
Warning: Broken symlinks were found. Remove them with `brew cleanup`:
  ファイルを削除した際に、シンボリックリンクが残っている場合などに発生するエラーです。メッセージにもある通り、下記のコマンドで壊れたシンボリックリンクを削除します。
brew cleanup
   
  今回はこれで無事にエラーがなくなりました。
$ brew doctor
  Your system is ready to brew.
  念のためこまめにHomebrewはアップデートしておきましょう。
$ brew update
  (参考にさせて頂いたサイト様) brew doctorのwarningを解決する
  • はてなブックマーク
  • Pocket
  • Linkedin
  • Feedly

この記事を書いた人

Twitter

sponserd

    keyword search

    recent posts

    • Twitter
    • Github
    contact usscroll to top
      • Facebook
      • Twitter
      • Github
      • Instagram