Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Installation 修复自制警告:目录不应以斜杠结尾_Installation_Homebrew - Fatal编程技术网

Installation 修复自制警告:目录不应以斜杠结尾

Installation 修复自制警告:目录不应以斜杠结尾,installation,homebrew,Installation,Homebrew,我今天安装了自制软件,按照应用程序的建议,我运行了 brew doctor 我得到这个警告: 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: /Users/MyUs

我今天安装了自制软件,按照应用程序的建议,我运行了

brew doctor
我得到这个警告:

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:
    /Users/MyUsername/
在谷歌上搜索了这个之后,我打开了它

vi ~/.bash_profile
从终端手动删除用户名后的“/”。现在我的.bash_配置文件如下所示:

export PATH=$PATH:/Users/MyUsername
export PATH=/usr/local/git/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/MyUsername

然后我重新输入了提示,得到了同样的警告。我该如何解决这个问题

您是否尝试重新启动终端?或者至少打开一个新会话(选项卡)

如果您使用的是zsh,则需要编辑~/.zshrc文件并删除“/usr/local/bin”结尾的尾随斜杠

编辑个人资料后,您必须告诉操作系统。从终端执行以下命令:
source ~/.bash_profile

这对我很有效;但是,它是我的
~/.profile
中的
导出路径…
,与zsh无关