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

相关推荐
Y3815326622 天前
Ruby 调用谷歌搜索 API:net/http 与 json 标准库实战
搜索引擎·ruby
我命由我123452 天前
Mac 操作系统 - 一些使用记录
运维·windows·学习·系统安全·运维开发·mac·学习方法
黑化旺仔3 天前
【OC】KVO
macos·ios·objective-c·cocoa
Liekkas Kono3 天前
macOS 27 安装 VMware Fusion 和 Win11 经验
macos·win11·vmware
shark-chili5 天前
关于AI辅助编程的认知
数据库·人工智能·redis·macos·缓存
程序员黎剑5 天前
RabbitMQ-消息可靠性-publisher-confirm持久化与手动ack
分布式·rabbitmq·ruby
我也要在julius_bar里藏钱5 天前
【山竹记账后端】1.搭建后端项目
后端·ruby·rails
zwd20055 天前
Mac 上写英文遇到不会的词,有哪些工具?输入法、翻译软件、写作助手怎么选
人工智能·macos·效率工具·英语写作·输入法·deepl·翻译工具
33三 三like5 天前
Jx-Mac 本地部署过程总结
macos
大象AI共学6 天前
想在手机上读 Obsidian?Mac → iPhone / 安卓的零成本方案
macos·智能手机·iphone