Centos7.2 install RVM (ruby-2.4.1)
Centos7.2 install RVM (ruby-2.4.1)
1. Install basic tools
[root@localhost ~]# yum install -y curl ruby
2. Check the existing version
[root@localhost node1]# ruby -v
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
3. Obtain rvm .io (found that the installation failed)
[root@localhost ~]# curl -L get.rvm.io | bash -s stable
The following error occurs
Centos7.2 install RVM (ruby-2.4.1)_bash
4. Add citations according to the prompts
[root@localhost ~]# curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
Centos7.2 Install RVM (ruby-2.4.1)_bash_02
or
[root@localhost ~]# curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
Centos7.2 install RVM (ruby-2.4.1)_rvm_03
5. Get rvm.io again (success!)
[root@localhost ~]# curl -L get.rvm.io | bash -s stable
Centos7.2 Install RVM (ruby-2.4.1)_Configuration File_04
6. Find the configuration file
[root@localhost ~]# find / -name rvm.sh
/etc/profile.d/rvm.sh
Make the configuration file effective
[root@localhost ~]# source /etc/profile.d/rvm.sh
Centos7.2 Install RVM (ruby-2.4.1)_bash_05
7. Download RVM dependencies
[root@localhost ~]# rvm requirements
Centos7.2 Install RVM (ruby-2.4.1)_ruby_06
8. Check the configuration file again
[root@localhost ~]# find / -name rvm -print
Centos7.2 Install RVM (ruby-2.4.1)_Configuration File_07
9. View rvm list
[root@localhost ~]# rvm list known
Centos7.2 Install RVM (ruby-2.4.1)_ruby_08
10. Install rvm v2.4.1
[root@localhost ~]# rvm install 2.4.1
Centos7.2 Install RVM (ruby-2.4.1)_bash_09
11. Configure environment variables
[root@localhost ~]# rvm use 2.4.1
Using /usr/local/rvm/gems/ruby-2.4.1
[root@localhost ~]# rvm use 2.4.1 --default
Using /usr/local/rvm/gems/ruby-2.4.1
Centos7.2 install RVM (ruby-2.4.1)_bash_10
12. Delete the old version of ruby
[root@localhost ~]# rvm remove 2.0.0p648
ruby-2.0.0p648 - #already gone
Using /usr/local/rvm/gems/ruby-2.4.1
13. View the final version
[root@localhost ~]# ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
At this point, Centos7.2 installation of RVM (ruby-2.4.1) is completed!