文本記錄于20200825
ruby安裝的前提是要有rvm,rvm安裝更新操作詳見《Mac系統(tǒng)更新RVM到最新版本》
- 更新前記錄:
系統(tǒng)版本:macOS Catalina(10.15.5)
ruby版本:2.6.3p62
$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
但是查詢已經(jīng)安裝的ruby時顯示并沒有安裝:
$ rvm list
# No rvm rubies installed yet. Try 'rvm help install'.
那么想要把當前版本設(shè)為默認版本芦劣,執(zhí)行命令也是不行:
$ rvm use 2.6.3 --default
Required ruby-2.6.3 is not installed.
To install do: 'rvm install "ruby-2.6.3"'
$ rvm use 2.6.3p62 --default
Required ruby-2.6.3p62 is not installed.
To install do: 'rvm install "ruby-2.6.3p62"'
兩個都不行利朵,我也不懂了赵,反正不行脓匿。 那就全部更新下到最新版本再說吧遍略。
- 版本更新操作記錄:
1.列出 Ruby 可安裝的版本信息
$ rvm list known
2.安裝一個 Ruby 版本
$ rvm install 2.7.0
3.如果想設(shè)置為默認版本,可以用這條命令來完成
$ rvm use 2.7.0 --default
按步驟查看當前rvm可安裝的ruby版本如下:
$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.9]
[ruby-]2.5[.7]
[ruby-]2.6[.5]
[ruby-]2.7[.0]
ruby-head
# for forks use: rvm install ruby-head-<name> --url https://github.com/github/ruby.git --branch 2.2
.
.
.
# IronRuby
ironruby[-1.1.3]
ironruby-head
查看到最新版本ruby版本是2.7崖咨,那就裝這個吧(時間賊久锻拘,裝了將近1個鐘頭 中間還發(fā)生失敗過一次,執(zhí)行原命令繼續(xù)下載):
$ rvm install 2.7 --default
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.7.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...........
Installing required packages: coreutils, libyaml, libksba, readline, zlib, openssl@1.1..............
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/XXX/.rvm/rubies/ruby-2.7.0, this may take a while depending on your cpu(s)...
ruby-2.7.0 - #downloading ruby-2.7.0, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
98 14.0M 98 13.7M 0 0 8007 0 0:30:36 0:30:00 0:00:36 16102
Warning: Transient problem: timeout Will retry in 2 seconds. 3 retries left.
Throwing away 14413569 bytes
58 14.0M 58 8366k 0 0 7310 0 0:33:31 0:19:32 0:13:59 0
curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
There was an error(56).
Checking fallback: https://ftp.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.bz2
** Resuming transfer from byte position 8567699
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
50 5991k 50 3008k 0 0 4718 0 0:21:40 0:10:52 0:10:48 0
curl: (56) LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
There was an error(56).
Failed download
There has been an error fetching the ruby interpreter. Halting the installation.
$ rvm install 2.7
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.7.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/XXX/.rvm/rubies/ruby-2.7.0, this may take a while depending on your cpu(s)...
ruby-2.7.0 - #downloading ruby-2.7.0, this may take a while depending on your connection...
** Resuming transfer from byte position 11648022
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:30 --:--:-- 0
Warning: Transient problem: timeout Will retry in 2 seconds. 3 retries left.
100 2983k 100 2983k 0 0 5676 0 0:08:58 0:08:58 --:--:-- 11850
ruby-2.7.0 - #extracting ruby-2.7.0 to /Users/XXX/.rvm/src/ruby-2.7.0.....
ruby-2.7.0 - #configuring.........................................................................
ruby-2.7.0 - #post-configuration.
ruby-2.7.0 - #compiling.......................................................................................................|
ruby-2.7.0 - #installing............
ruby-2.7.0 - #making binaries executable...
Installed rubygems 3.1.2 is newer than 3.0.8 provided with installed ruby, skipping installation, use --force to force installation.
ruby-2.7.0 - #gemset created /Users/XXX/.rvm/gems/ruby-2.7.0@global
ruby-2.7.0 - #importing gemset /Users/XXX/.rvm/gemsets/global.gems.........................................................-
ruby-2.7.0 - #generating global wrappers.......
ruby-2.7.0 - #gemset created /Users/XXX/.rvm/gems/ruby-2.7.0
ruby-2.7.0 - #importing gemsetfile /Users/XXX/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.7.0 - #generating default wrappers.......
ruby-2.7.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.7.0 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
更新命令執(zhí)行結(jié)束击蹲, 那么來看下ruby版本和安裝信息:
$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
$ rvm list
=* ruby-2.7.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
這就算是更新成功過了署拟。