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

相关推荐
七歌杜金房5 分钟前
我终于又有了自己的 Linux 电脑
linux·debian·mac
Mintimate6 小时前
WorkBuddy 上手: 让脚本项目 Homebrew CN 变成会排障的 Agent
macos·边缘计算·agent
fthux2 天前
如果你用 Mac,那你可能需要 Noti Shift
macos·开源·github
counterxing4 天前
最近发现一个 Mac 工具,有点像把 Raycast、语音输入法、截图和录屏塞到了一起
macos·ai编程·claude
Tigger7 天前
受不了 ¥98/年的订阅,我用 Vibe Coding 自己写了个剪贴板工具
人工智能·开源·mac
元Y亨H12 天前
MacBook Air 开发神器:IDEA 与 PyCharm 极简安装及环境配置
macos
yuanyxh12 天前
macOS 应用 - 纯对话生成
前端·macos·ai编程
pe7er12 天前
Mac 修复「XXXXX已损坏,无法打开」完整方案
mac
AI创界者14 天前
PilotTTS 一键整合包(Win/Mac):8G 显存畅跑,实测解锁情绪与副语言的精准控制
人工智能·macos·aigc·音视频
AirDroid_cn14 天前
系统终端与iTerm2字体看起来不一样?macOS Sequoia统一渲染指南
macos