参考文档:
1、《Mac—RVM的更新,以及Ruby的更新》
2、《curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused的几种解决方式》:其中有多种方案,这次用了方案一就过了。
以下则是本次实际操作记录,记录于20200825
- 更新前记录:
系统版本:macOS Catalina(10.15.5)
RVM版本:1.29.6(应该是系统默认,已知不是最新版本)
$ rvm -v
rvm 1.29.6 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
- 执行更新RVM记录:
执行更新命令(更新到最新稳定版本)->报错:
$ rvm get stable
Downloading https://get.rvm.io
Could not download rvm-installer, please report to https://github.com/rvm/rvm/issues
执行安装命令->也是报错:
$ curl -sSL https://get.rvm.io | bash -s stable
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
查阅参考文档文章,方案是替换host文件:
(1)打开网站: https://www.ipaddress.com/
(2)查询一下 raw.githubusercontent.com对应的IP地址
(3)进入 /etc 目录下替换系统的 hosts 文件(直接修改是没有权限的,复制出来修改后拷贝进去替换)
注意:最好备份一份
hosts文件中最后加入一行:
199.232.68.133 raw.githubusercontent.com
此时在终端中 ping 一下 raw.githubusercontent.com 如果可以ping通则继续后续操作。
开始正常更新RVM,命令行中执行:
$ curl -sSL https://get.rvm.io | bash -s stable
curl: (7) Failed to connect to api.github.com port 443: Connection refused
WARN: ...the preceeding error with code 7 occurred while fetching https://api.github.com/repos/rvm/rvm/tags
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/XXX/.rvm/
RVM PATH line found in /Users/XXX/.mkshrc /Users/XXX/.profile /Users/XXX/.bashrc /Users/XXX/.zshrc.
RVM sourcing line found in /Users/XXX/.profile /Users/XXX/.bash_profile /Users/XXX/.zlogin.
Upgrade of RVM in /Users/XXX/.rvm/ is complete.
Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.
👉 Donate: https://opencollective.com/rvm/donate
开始有报错,但是无碍(大概网络问题),反正装上了。
查看当前版本:
$ rvm -v
RVM version 1.29.9 (latest) is installed, yet version 1.29.6 (latest) is loaded.
Please open a new shell or run one of the following commands:
rvm reload
echo rvm_auto_reload_flag=1 >> ~/.rvmrc # OR for auto reload with msg
echo rvm_auto_reload_flag=2 >> ~/.rvmrc # OR for silent auto reload
看到已经装了1.29.9版本的(不知道为何不是最新的1.29.10),但是提示旧版本仍在加载中,根据提示新打开一个终端运行如下命令:
$ rvm reload
RVM reloaded!
此时查看RVM版本信息(正常显示1.29.9):
$ rvm -v
rvm 1.29.9 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
进行到这里其实就可以了。
但是我继续执行了下命令(这次很快):
$ 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.10.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.10/1.29.10.tar.gz.asc
Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.29.10/1.29.10.tar.gz.asc',
but no GPG software exists to validate it, skipping.
Upgrading the RVM installation in /Users/XXX/.rvm/
RVM PATH line found in /Users/XXX/.mkshrc /Users/XXX/.profile /Users/XXX/.bashrc /Users/XXX/.zshrc.
RVM sourcing line found in /Users/XXX/.profile /Users/XXX/.bash_profile /Users/XXX/.zlogin.
Upgrade of RVM in /Users/XXX/.rvm/ is complete.
Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.
👉 Donate: https://opencollective.com/rvm/donate
RVM reloaded!
查看版本如下:
$ rvm -v
rvm 1.29.10 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
至此,RVM更新完毕并且重新加载最新的版本。