Mac安装Homebrew

安装Homebrew的命令:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

在我安装Homebrew的过程中遇到了好多问题,

第一个问题是

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

fatal: The remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

原因:curl的postBuffer的默认值太小

解决方案:终端执行git config --global http.postBuffer 524288000,把postBuffer值改成500M

然后我执行了上面安装homebrew的命令,又报了下面的错误

Warning: /usr/local/bin is not in your PATH

原因:没有配置path

解决方案:

1、touch .bash_profile

2、open .bash_profile

3、在打开的文件中添加:export PATH=/usr/local/bin:$PATH

4、source .bash_profile


然后再次执行这个命令安装homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

这次没有报错了

然后输入brew验证是否安装

成功以后会显示如下内容

你可能感兴趣的:(Mac安装Homebrew)