38
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Warning: "config" scripts exist outside your system or Homebrew directories.

Last updated at Posted at 2018-08-24

事象:brew doctorしたら警告が出た。

  • 環境 : macOS Catalina バージョン10.15.6
# doctorしたら出た警告
% 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: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which 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:
  /Library/Frameworks/Python.framework/Versions/3.8/bin/python3-config
  /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8-config

原因:Homebrew管理外のconfigファイルがあると衝突するかもしれないと心配されている。

Homebrewの管理外な*-configファイルがあると衝突おこすかも
【Homebrew】brew doctorのWarning対処方法 (その3) + envコマンドについて - TASK NOTES

そういえばPythonは、Homebrewを使わないでインストールした。
MacにPython3とPyCharmをインストールする方法 - ponsuke_tarou’s blog

「PATHの中に追加の(config)スクリプトがあると、Homebrewでインストールされるソフトウェアを混乱させるかもよ。もし、そのconfigスクリプトが、システムやHomebrewで供給される同じ名前のスクリプトを上書きした場合にはね。」
Warning: “config” scripts exist outside your system or Homebrew directories. brew doctor 時の警告 | EasyRamble

# PATHを確認してみる
% echo $PATH
/Library/Frameworks/Python.framework/Versions/3.8/bin:...省略...
# 犯人はこれらしい↑

対応:.zshrcにHomwbrewのエイリアスを追加する。

Bashを使う人は.bash_profileに、Zshを使う人は.zshrcにHomwbrewのエイリアスを追加する。

# 1. エイリアスを追加する
% echo 'alias brew="env PATH=${PATH/\/Library\/Frameworks\/Python\.framework\/Versions/3\.8/bin:/} brew"' >> .zshrc

# 2. 反映する
% source ~/.zshrc 

# 3. 対応後
% brew doctor
Your system is ready to brew.

事象 : Visual Studio Codeのターミナルでdoctorに言われた

  • 環境
    • macOS BigSurバージョン11.1
    • Visual Studio Code Version 1.52.1
$ 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: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which 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:
  /Library/Frameworks/Python.framework/Versions/3.8/bin/python3-config
  /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8-config

.zshrcにHomwbrewのエイリアスを書いてあるのになぜ?

.zshrc
alias brew="env PATH=${PATH/\/Library\/Frameworks\/Python\.framework\/Versions/3\.8/bin:/} brew"

原因 : Visual Studio Codeのシェルがzshじゃなくなる

ふと気がついた・・・・brew doctorするとシェルが
zsh > bash > perl
と切り替わっている・・・ということは.zshrcにHomwbrewのエイリアスを書いても使われない・・・。

タイトルなし.gif

対応 : brewはVisual Studio Codeでやらない

ただ諦めただけ。ふつうにMacのターミナルを使う。

38
34
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
38
34

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?