Mac系統(tǒng)更新RVM到最新版本

參考文檔:
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更新完畢并且重新加載最新的版本。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容