Mac 升级ruby 升级brew update

本文讲述了在Mac上遇到Homebrew更新和安装Ruby时遇到的Git错误,如远程结束意外中断等问题,通过调整`gitconfig`、更新源和修改`bash_profile`路径,最终成功解决问题的过程。
摘要由CSDN通过智能技术生成

Mac 自身版本是2.x  查看ruby版本号 打开终端 ruby -v

1.brew update

  如果报错    这时候brew更新出问题了   

fatal: the remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

error: RPC failed; curl 18 HTTP/2 stream 3 was reset

fatal: the remote end hung up unexpectedly

fatal: early EOF

fatal: index-pack failed

Error: Fetching /usr/local/Homebrew failed!

Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!

这是git 错误 终端执行 我看网上说这是git错误 所以我根据网上继续增加git的大小 

git config http.postBuffer 204288000 (这个大小根据自己需求来)

2.继续执行 brew update  还是报错通第一步一样的错误

  git config --list 可以看 上面的大小是否设置成功

  

3. git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

fatal: destination path '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core' already exists and is not an empty directory.

4 .cd "$(brew --repo)"

5.git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

cool_mac@videozudabaoji Homebrew % cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" 

cool_mac@videozudabaoji homebrew-core % git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

6. brew update (终于成功了)下图所有命令

7 homebrew-core % brew -v  发现是最新的了

8.继续执行 brew install ruby 

注意如果是mac 13系统以上是配置在这两个文件里面 随便一个就行 如果bash_profile配置了有就删掉

9.echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

10.source ~/.bash_profile

  • 28
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值