os: centos 7.5
ruby:2.4.4安装rvm
# curl -L get.rvm.io | bash -s stable % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 194 100 194 0 0 255 0 --:--:-- --:--:-- --:--:-- 255100 24361 100 24361 0 0 7694 0 0:00:03 0:00:03 --:--:-- 16016Downloading https://github.com/rvm/rvm/archive/1.29.4.tar.gzDownloading https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.tar.gz.ascgpg: directory `/root/.gnupg' createdgpg: new configuration file `/root/.gnupg/gpg.conf' createdgpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this rungpg: keyring `/root/.gnupg/pubring.gpg' createdgpg: Signature made Mon 02 Jul 2018 03:41:26 AM CST using RSA key ID BF04FF17gpg: Can't check signature: No public keyWarning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found. Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.29.4.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.tar.gz.asc'! Try to install GPG v2 and then fetch the public key: gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3or if it fails: command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -the key can be compared with: https://rvm.io/mpapis.asc https://keybase.io/mpapisNOTE: GPG version 2.1.17 have a bug which cause failures during fetching keys from remote server. Please downgrade or upgrade to newer version (if available) or use the second method described above.
导入public key
# gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3gpg: keyring `/root/.gnupg/secring.gpg' createdgpg: requesting key D39DC0E3 from hkp server keys.gnupg.netgpg: /root/.gnupg/trustdb.gpg: trustdb createdgpg: key D39DC0E3: public key "Michal Papis (RVM signing)" importedgpg: no ultimately trusted keys foundgpg: Total number processed: 1gpg: imported: 1 (RSA: 1)
重新安装rvm
# curl -L get.rvm.io | bash -s stable % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 194 100 194 0 0 401 0 --:--:-- --:--:-- --:--:-- 401100 24361 100 24361 0 0 15023 0 0:00:01 0:00:01 --:--:-- 51286Downloading https://github.com/rvm/rvm/archive/1.29.4.tar.gzDownloading https://github.com/rvm/rvm/releases/download/1.29.4/1.29.4.tar.gz.ascgpg: Signature made Mon 02 Jul 2018 03:41:26 AM CST using RSA key ID BF04FF17gpg: Good signature from "Michal Papis (RVM signing)"gpg: aka "Michal Papis "gpg: aka "[jpeg image of size 5015]"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 FF17GPG verified '/usr/local/rvm/archives/rvm-1.29.4.tgz'Creating group 'rvm'Installing RVM to /usr/local/rvm/Installation of RVM in /usr/local/rvm/ is almost complete: * First you need to add all users that will be using rvm to 'rvm' group, and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`. * To start using RVM you need to run `source /etc/profile.d/rvm.sh` in all your open shell windows, in rare cases you need to reopen all shell windows. * Please do NOT forget to add your users to the rvm group. The installer no longer auto-adds root or users to the rvm group. Admins must do this. Also, please note that group memberships are ONLY evaluated at login time. This means that users must log out then back in before group membership takes effect!
安装一个ruby版本
# source /usr/local/rvm/scripts/rvm# rvm list known# rvm install 1.9.3# rvm use 1.9.3# rvm remove 1.9.3# rvm install 2.4.4# rvm use 2.4.4# ruby --versionruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-linux]
参考: