该文为macOS Catalina 10.15.1中安装Python3 完全安装攻略的衍生小文章。
官网文档:
Upgrading RVM RVM supports few ways of upgrading itself. Every month
or two a stable release of RVM is created, it includes minor version
increase.
每一到两个月都会有一个正式的稳定版。
To upgrade to the most stable version
升级到最新的稳定版本(译)
$ rvm get stable
正常情况下的升级,这一句代码就足够了。但是如果有意外情况,官方文档也给出了详细步骤。
Is rvm get stable not working?
Is rvm get latest telling you
“You already have the latest version!” , but you know you don’t?
Try this:
rvm升级到稳定版没效果?
rvm最新版本告诉你“你已经是最新版本了”,但是你知道并不是?
那么试试下面的命令
$ rvm get head
$ rvm reload
$ rvm get stable
If that does not work for you, you can always use the installer to
update:
如果这样任然没有效果,你随时可以使用安装程序来进行升级
$ \curl -sSL https://get.rvm.io | bash -s stable
$ rvm reload
因为用的代码引用,所以//后面的被注释了,直接复制整行命令就好
Upgrading to the latest repository source version (the most bugfixes)
升级到最新源码版本(修复最多bug的版本)
$ rvm get head
开始更新Ruby
1、查看Ruby版本
$ rvm list known
#列出已知的ruby版本
Warning, new version of rvm available '1.29.9-next', you are using older version '1.26.11'.
问题:
发现rvm版本也需要更新
2、更新rvm
$ rvm get stable
Downloading https://get.rvm.io
No GPG software exists to validate rvm-installer, skipping.
Downloading https://github.com/rvm/rvm/archive/1.29.9.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.asc
Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.asc',
but no GPG software exists to validate it, skipping.
Upgrading the RVM installation in /Users/xiatian/.rvm/
RVM PATH line found in /Users/xiatian/.mkshrc /Users/xiatian/.profile /Users/xiatian/.bashrc /Users/xiatian/.zshrc.
RVM sourcing line found in /Users/xiatian/.profile /Users/xiatian/.bash_profile /Users/xiatian/.zlogin.
Upgrade of RVM in /Users/xiatian/.rvm/ is complete.
* RVM 1.30 simplifies behavior of 'rvm wrapper' subcommand
Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.
👉 Donate: https://opencollective.com/rvm/donate
RVM reloaded!
3、安装Ruby最新版本2.6.5
$ rvm install ruby-2.6.5
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.5.
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...........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-2.6.5',
please read /Users/xiatian/.rvm/log/1574165496_ruby-2.6.5/update_system.log
Requirements installation failed with status: 1.
再次运行:
$ brew install ruby
Updating Homebrew...
Error: readline: undefined method `undent' for #<String:0x00007fd7d955c130>
解决
先运行下面命令
$ rvm autolibs read-only
再安装:
$ rvm install ruby-2.6.5
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Missing required packages: coreutils readline zlib openssl@1.1
Somehow it happened there is no executable 'openssl',
run 'brew doctor' and make sure latest 'openssl@1.1' is installed properly.
Requirements installation successful.
查看版本:
$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
安装成功。
参考文章:
Mac——RVM的更新,以及Ruby的更新