更新ruby版本的命令及问题

查看版本号,如图所示

rvm list // 查看当前的版本号
rvm list known // 查看所有版本

更新命令

rvm install 版本号 // rvm install 3.0.0

如果出现以下错误

MacBook-Pro  ~  rvm install 3.0.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/11.1/x86_64/ruby-3.0.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing requirements for osx.
Updating system - please wait
Failed to update Homebrew, follow instructions at
    https://docs.brew.sh/Common-Issues
and make sure `brew update` works before continuing.
Error running 'requirements_osx_brew_update_system ruby-3.0.0',
please read /Users/hanwenguang/.rvm/log/1619575510_ruby-3.0.0/update_system.log
Requirements installation failed with status: 1.

为了干净,请先使用以下命令删除homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
删除成功

出现以下文字时候即已经删除成功,可进行重新安装

'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
'brew -v' // 版本号查询
// 显示 zsh: command not found: brew
'curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install'
'git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1'
// 以上问题还是出现
'/usr/bin/ruby brew_install'
// 出现错误  Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!Fetching /usr/local/Homebrew failed!
// 执行以下命令
'sudo chown -R xxx:staff'
// xxx查询命令
'whoami' // 我是谁
// 再次执行
'/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
// 查询brew版本
‘'brew -v' // 显示 3.1.3,成功
'pod --version' // 显示版本 1.4.0

你可能感兴趣的:(更新ruby版本的命令及问题)