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

相关推荐
2501_916008894 小时前
iOS开发者工具有哪些?Xcode、Fastlane 与 kxapp 的组合使用
ide·vscode·macos·ios·个人开发·xcode·敏捷流程
June bug8 小时前
(Mac)docling-mcp 的依赖解析器找不到匹配的 torch 安装包
经验分享·python·macos
MonkeyKing_sunyuhua8 小时前
Mac 安装 OpenClaw 的详细步骤
macos·openclaw
KevinCyao9 小时前
Ruby短信营销接口示例代码:Ruby开发环境下营销短信API接口的集成与Demo演示
开发语言·前端·ruby
新缸中之脑9 小时前
FineTune Studio:Mac微调AI工具
人工智能·macos
蜡台9 小时前
macOS 无法启动 MySQL服务解决
数据库·mysql·macos
jian1105810 小时前
Mac git生成SSH秘钥
git·macos·ssh
音视频牛哥10 小时前
面向工业级应用的 iOS 平台 RTSP|RTMP 超低延迟播放器集成指南
macos·objective-c·cocoa·ios rtmp播放器·ios rtsp播放器·ios rtmp player·ios rtsp player
今夕资源网10 小时前
github开源桌面快速启动神器:ZTools 高性能 可扩展应用启动器,支持macOS/Windows,适配办公与开发需求
macos·github·工具箱·ztools·桌面启动·音速启动·高性能启动器
golang学习记1 天前
macOS 技巧:使用修饰键控制热角(Hot Corners)
macos