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 小时前
我在 Mac 用一行脚本征服了 5TB NTFS:拒绝付费,彻底搞定免费方案
macos·mac
前端架构师-老李7 小时前
Maven安装以及环境变量配置(macOS)
java·macos·maven
上去我就QWER19 小时前
macOS下如何全文检索epub格式文件?
macos
谢娘蓝桥20 小时前
Mac 安装 Xcode 及qt 环境安装
ide·macos·xcode
witton1 天前
克隆整个macOS系统到新磁盘
macos·asr·克隆·复制·迁移·恢复·restore
熊小猿1 天前
RabbitMQ死信交换机与延迟队列:原理、实现与最佳实践
开发语言·后端·ruby
csdn_aspnet1 天前
如何在 Mac、Ubuntu、CentOS、Windows 上安装 MySQL 客户端
linux·windows·mysql·macos·centos
我的golang之路果然有问题1 天前
mac M系列芯片 unity 安装会遇到的错误以及解决
经验分享·学习·macos·unity·游戏引擎
心灵宝贝1 天前
如何安装 PDF Reader Pro for Mac v3.2.1.0?超简单DMG安装步骤(附安装包)
macos
by__csdn1 天前
nvm命令使用,nvm国内镜像,nvm命令for Linux/Mac
linux·运维·macos