Mac 升级ruby 升级brew update

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 可以看 上面的大小是否设置成功

  1. 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

  1. 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

相关推荐
weixin_438732108 小时前
ChromeDriver谷歌驱动下载
linux·chrome·selenium·自动化·mac·chrome devtools·chromedriver
ASKED_201915 小时前
macOS 使用 Codex CLI 登录报错 403 的问题分析与解决方案(Issue #2414)
macos·issue
roo_116 小时前
JAVA学习-MAC搭建java环境和spring boot搭建
java·学习·macos
Knight_AL16 小时前
RabbitMQ + Flink 为什么必然会重复?以及如何用 seq 做稳定去重
flink·rabbitmq·ruby
Digitally16 小时前
如何在 Mac 上进行屏幕录制(分步教程)
macos
2501_9160088916 小时前
在不越狱前提下导出 iOS 应用文件的过程,访问应用沙盒目录,获取真实数据
android·macos·ios·小程序·uni-app·cocoa·iphone
vchao_16 小时前
Mac升级系统后反复重启问题
macos·反复重启
TheNextByte116 小时前
如何在Mac上获取Android消息
android·macos
虹少侠16 小时前
基于 WebKit 构建 macOS 多浮窗视频播放的技术实践(含完整产品落地)
前端·macos·swift·webkit
TheNextByte116 小时前
快速将Android连接到Mac 6 种简单方法
android·macos