没有 Ruby 无法在 macOS 中安装 RVM,没有 RVM 无法升级 Ruby
Cannot install RVM in macOS without Ruby, cannot upgrade Ruby without RVM
我当前的 Ruby 版本是:
$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
我需要更新版本的 Ruby 所以我尝试安装它,但是我没有安装 RVM:
$ rvm
-bash: rvm: command not found
为了安装 RVM,我去了 https://rvm.io 并按照说明进行操作。但是,在第二个命令中,我得到了以下信息:
$ \curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.4.tar.gz
Downloading
https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.tar.gz.asc
gpg: Signature made Sun 1 Jul 20:41:26 2018 BST
gpg: using RSA key 62C9E5F4DA300D94AC36166BE206C29FBF04FF17
gpg: Good signature from "Michal Papis (RVM signing) <mpapis@gmail.com>" [unknown]
gpg: aka "Michal Papis <michal.papis@toptal.com>" [unknown]
gpg: aka "[jpeg image of size 5015]" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 409B 6B17 96C2 7546 2A17 0311 3804 BB82 D39D C0E3
Subkey fingerprint: 62C9 E5F4 DA30 0D94 AC36 166B E206 C29F BF04 FF17
GPG verified '/Users/me/.rvm/archives/rvm-1.29.4.tgz'
Upgrading the RVM installation in /Users/me/.rvm/
RVM PATH line found in /Users/me/.mkshrc /Users/me/.profile /Users/me/.bashrc /Users/me/.zshrc.
RVM sourcing line found in /Users/me/.profile /Users/me/.bash_profile /Users/me/.zlogin.
./scripts/functions/support: line 559: 65301 Abort trap: 6 "$ruby_path" -rrbconfig -e '\
File.open("'"$config_path"'","w") { |file|
RbConfig::CONFIG.sort.each{|key,value|
file.write("#{key.gsub(/\.|-/,"_")}=\"# {value.to_s.gsub("$","\$")}\"\n")
}
}
' > /dev/null 2>&1
Can not save config data for ruby: 'ruby-2.5.1', most likely it is broken installation and you can:
- try fix it: 'rvm reinstall ruby-2.5.1', OR:
- remove it: 'rvm uninstall ruby-2.5.1 --gems'
Upgrade of RVM in /Users/me/.rvm/ is complete.
但是,RVM 没有安装或升级,因为我仍然得到:
$ rvm reload
-bash: rvm: command not found
有人知道问题出在哪里吗?我知道我可以在没有 RVM 的情况下升级 Ruby,但我不想这样做。
答案是输入:
$ source ~/.rvm/scripts/rvm
然后升级ruby
rvm reinstall ruby-2.5.1
所以我现在有
$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16]
我当前的 Ruby 版本是:
$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
我需要更新版本的 Ruby 所以我尝试安装它,但是我没有安装 RVM:
$ rvm
-bash: rvm: command not found
为了安装 RVM,我去了 https://rvm.io 并按照说明进行操作。但是,在第二个命令中,我得到了以下信息:
$ \curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.4.tar.gz
Downloading
https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.tar.gz.asc
gpg: Signature made Sun 1 Jul 20:41:26 2018 BST
gpg: using RSA key 62C9E5F4DA300D94AC36166BE206C29FBF04FF17
gpg: Good signature from "Michal Papis (RVM signing) <mpapis@gmail.com>" [unknown]
gpg: aka "Michal Papis <michal.papis@toptal.com>" [unknown]
gpg: aka "[jpeg image of size 5015]" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 409B 6B17 96C2 7546 2A17 0311 3804 BB82 D39D C0E3
Subkey fingerprint: 62C9 E5F4 DA30 0D94 AC36 166B E206 C29F BF04 FF17
GPG verified '/Users/me/.rvm/archives/rvm-1.29.4.tgz'
Upgrading the RVM installation in /Users/me/.rvm/
RVM PATH line found in /Users/me/.mkshrc /Users/me/.profile /Users/me/.bashrc /Users/me/.zshrc.
RVM sourcing line found in /Users/me/.profile /Users/me/.bash_profile /Users/me/.zlogin.
./scripts/functions/support: line 559: 65301 Abort trap: 6 "$ruby_path" -rrbconfig -e '\
File.open("'"$config_path"'","w") { |file|
RbConfig::CONFIG.sort.each{|key,value|
file.write("#{key.gsub(/\.|-/,"_")}=\"# {value.to_s.gsub("$","\$")}\"\n")
}
}
' > /dev/null 2>&1
Can not save config data for ruby: 'ruby-2.5.1', most likely it is broken installation and you can:
- try fix it: 'rvm reinstall ruby-2.5.1', OR:
- remove it: 'rvm uninstall ruby-2.5.1 --gems'
Upgrade of RVM in /Users/me/.rvm/ is complete.
但是,RVM 没有安装或升级,因为我仍然得到:
$ rvm reload
-bash: rvm: command not found
有人知道问题出在哪里吗?我知道我可以在没有 RVM 的情况下升级 Ruby,但我不想这样做。
答案是输入:
$ source ~/.rvm/scripts/rvm
然后升级ruby
rvm reinstall ruby-2.5.1
所以我现在有
$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin16]