Help us understand the problem. What is going on with this article?

pyenv をインストールしてると brew doctor で出る Warning を消す方法

pyenv をインストールしてると brew doctor で下記のような Warning が出る。それを消す方法をメモっとく。

$ 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 and just ignore them. 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 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/takuya/.pyenv/shims/python-config
  /Users/takuya/.pyenv/shims/python3-config
  /Users/takuya/.pyenv/shims/python3.5-config
  /Users/takuya/.pyenv/shims/python3.5m-config

端的に言えば PATH 環境変数に /Users/takuya/.pyenv/shims のように pyenv のディレクトリが含まれてしまうのが原因。Homebrew を実行するときにだけ PATH 環境変数に pyenv のディレクトリが含まれない形にしてあげればいい。

ということで、brew コマンドのエイリアスを下記のように .bash_profile あたりで設定すれば解決する。参考にしたサイトでは置換してるけど、Homebrew 実行時に参照したい PATH 環境変数をベタに書く方法でいいかと。phpenv などを入れたときも修正が要らないだろうし。

alias brew="PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin brew"

参考文献

http://www.task-notes.com/entry/20141223/1419324649
http://qiita.com/takc923/items/45386905f70fde9af0e7

takuya0301
Mikatus 株式会社の VP Engineering 兼デザイングループグループリーダー。最近は Event Storming と Lagom に興味がある。
https://takuya0301.github.io
mikatus
税理士・会計事務所向けクラウドシステムの企画、開発、提供事業を行っております。
https://www.mikatus.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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした