Adams-MacBook-Pro% brew doctor Error: /usr/bin occurs before /usr/local/bin This means that system-provided programs will be used instead of those provided by Homebrew. The following tools exist at both paths: clusterdb createdb createlang createuser dropdb droplang dropuser ecpg git git-cvsserver git-receive-pack git-shell git-upload-archive git-upload-pack gitk pg_config pg_dump pg_dumpall pg_restore pg_upgrade psql reindexdb vacuumdb Consider amending your PATH so that /usr/local/bin is ahead of /usr/bin in your PATH.
这里是我的路径:
Adams-MacBook-Pro% echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
我认为把东西搬到前面是危险的?如何解决这个问题?此外,我甚至不知道在哪里/ user / bin在路径中声明的位置。
谢谢
$ PATH只是一个包含字符串的变量。把东西放在前面:
% PATH=/usr/local/bin:$PATH % echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
这不是危险的,因为它只适用于你打开的当前shell(它不会影响你的系统或其他shell的路径)。
要为您打开的所有shell自动更改路径,请将其放在〜/ .profile中。如果此文件不存在,您可以创建此文件。
在〜/ .profile:
homebrew=/usr/local/bin:/usr/local/sbin export PATH=$homebrew:$PATH
export
使该变量可用于shell的任何子进程。