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

相关推荐
CHH32133 小时前
在 Mac/linux 的 VSCode 中使用Remote-SSH远程连接 Windows
linux·windows·vscode·macos
心灵宝贝5 小时前
Mac 桌面动态壁纸软件|Live Wallpaper 4K Pro v19.7 安装包使用教程(附安装包)
macos
William.csj12 小时前
Mac——文件夹压缩的简便方法
macos
北冥有鱼被烹12 小时前
【问题】Mac 的 Finder 中没有桌面选项如何处理?(访达 -> 设置 -> 边栏 -> 勾选桌面)
macos
wenxiaocsdn15 小时前
macos虚拟机-演示篇三配置clover引导
macos
迷路爸爸18017 小时前
源码编译安装最新 tmux 教程(含 Debian/Ubuntu/CentOS/Arch/macOS 等系统)
linux·ubuntu·macos·centos·debian·tmux·archlinux
xingxing_F17 小时前
Rhino 8 for Mac 犀牛3D建模软件
macos·3d
takashi_void1 天前
如何在本地部署大语言模型(Windows,Mac,Linux)三系统教程
linux·人工智能·windows·macos·语言模型·nlp
哦豁灬1 天前
macOS 常用快捷键
macos
LinXunFeng1 天前
如何舒适地沉浸式编程,这是我的答案
windows·程序员·mac