參考文檔:
1、《Mac—RVM的更新,以及Ruby的更新》
2、《curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused的幾種解決方式》:其中有多種方案,這次用了方案一就過了。
以下則是本次實(shí)際操作記錄,記錄于20200825
- 更新前記錄:
系統(tǒng)版本:macOS Catalina(10.15.5)
RVM版本:1.29.6(應(yīng)該是系統(tǒng)默認(rèn),已知不是最新版本)
$ rvm -v
rvm 1.29.6 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
- 執(zhí)行更新RVM記錄:
執(zhí)行更新命令(更新到最新穩(wěn)定版本)->報(bào)錯(cuò):
$ rvm get stable
Downloading https://get.rvm.io
Could not download rvm-installer, please report to https://github.com/rvm/rvm/issues
執(zhí)行安裝命令->也是報(bào)錯(cuò):
$ curl -sSL https://get.rvm.io | bash -s stable
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
查閱參考文檔文章,方案是替換host文件:
(1)打開網(wǎng)站: https://www.ipaddress.com/
(2)查詢一下 raw.githubusercontent.com對應(yīng)的IP地址
(3)進(jìn)入 /etc 目錄下替換系統(tǒng)的 hosts 文件(直接修改是沒有權(quán)限的,復(fù)制出來修改后拷貝進(jìn)去替換)
注意:最好備份一份
hosts文件中最后加入一行:
199.232.68.133 raw.githubusercontent.com
此時(shí)在終端中 ping 一下 raw.githubusercontent.com 如果可以ping通則繼續(xù)后續(xù)操作。
開始正常更新RVM,命令行中執(zhí)行:
$ 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
開始有報(bào)錯(cuò),但是無礙(大概網(wǎng)絡(luò)問題),反正裝上了。
查看當(dāng)前版本:
$ 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
看到已經(jīng)裝了1.29.9版本的(不知道為何不是最新的1.29.10),但是提示舊版本仍在加載中,根據(jù)提示新打開一個(gè)終端運(yùn)行如下命令:
$ rvm reload
RVM reloaded!
此時(shí)查看RVM版本信息(正常顯示1.29.9):
$ rvm -v
rvm 1.29.9 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
進(jìn)行到這里其實(shí)就可以了。
但是我繼續(xù)執(zhí)行了下命令(這次很快):
$ 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更新完畢并且重新加載最新的版本。