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

相关推荐
Wcowin1 小时前
OneClip 开发经验分享:从零到一的 macOS 剪切板应用开发
mac·swift·粘贴板
互亿无线明明8 小时前
国际短信通知服务:如何为全球业务构建稳定的跨国消息触达体系?
java·c语言·python·php·objective-c·ruby·composer
木兰不吃草13 小时前
mac playCover 金铲铲无法使用麦克风问题详细教程
macos·语音·麦克风·playcover·金铲铲
伟大的大威14 小时前
【零基础入门】Open-AutoGLM 完全指南:Mac 本地部署 AI 手机助理(原理+部署+优化)附上修改后代码
macos
xing-xing14 小时前
Java多版本配置及版本切换(Mac适配)
java·macos
_Johnny_15 小时前
解决Mac安装软件提示`已损坏无法打开`,`请移到废纸篓`
macos
雪域迷影15 小时前
macOS中使用cJSON解析库解析JSON
c++·macos·json·c·cmake·pkg-config
qq_251533591 天前
使用 Python 提取 MAC 地址
网络·python·macos
24zhgjx-fuhao2 天前
配置MAC地址安全
macos
Wcowin2 天前
OneClip 开发经验分享:从零到一的 macOS 应用开发
经验分享·macos·策略模式