当前位置:   article > 正文

Mac安装brew_mac brew already installed

mac brew already installed

步骤1

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
若提示:

It appears Homebrew is already installed. If your intent is to reinstall you

should do the following before running this installer again:

则可以执行,卸载原先到brew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
此步骤会删除原先通过brew安装的命令
再执行步骤1,提示Install Success信息
步骤2 在终端上输入brew 测试是否安装成功,结果显示:
-brew: command not found
原因是brew默认安装在/usr/local/bin下,但是该路径没有添加到系统环境变量中,解决办法如下:
打开~/.bashrc 文件,在末尾添加如下:

export PATH=/usr/local/bin:$PATH

保存退出后执行如下语句让配置生效:

source .bashrc 

如果遇到修改文件失败,一般.bashrc是只读模式,修改下文件读写权限:
chmod -R 775 .bashrc
 
然后就可以用brew进行安装其他软件了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/256746
推荐阅读
相关标签
  

闽ICP备14008679号