1、安装基本工具
[root@localhost ~]# yum -y install ruby ruby-devel rubygems rpm-build
2、查看当前版本
[root@localhost ~]# ruby -v
效果:
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
3、安装yum源
[root@localhost ~]# yum install -y centos-release-scl-rh
4、安装指定版本的ruby
yum install -y rh-ruby30
[root@localhost ~]# yum install -y rh-ruby24
5、使升级后的配置生效
scl enable rh-ruby30 bash
6、查看当前ruby版本
[root@localhost ~]# ruby -v
效果:
ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
至此 ruby 升级至 v3.0 完毕
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
标签:ruby,升级,yum,install,root,rh,localhost From: https://www.cnblogs.com/gaoyuechen/p/16664968.html