MacOS升级ruby版本

在 macOS 上升级 Ruby 版本可以通过多种方式实现,最常用的方式是使用 Ruby 版本管理工具,如 rbenv 或 RVM (Ruby Version Manager)。以下是使用这两种工具的详细步骤,以及其他方法来升级 Ruby。

方法 1: 使用 rbenv

  1. 安装 rbenv

如果你还没有安装 rbenv,可以使用 Homebrew 安装它:

brew update
brew install rbenv

然后,添加 rbenv 到你的 shell 配置文件(例如 ~/.bash_profile 或 ~/.zshrc):

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile


# 或者如果你使用 zsh
echo 'eval "$(rbenv init -)"' >> ~/.zshrc

运行以下命令使更改生效:

你可能感兴趣的:(ai分析,macos)