zl程序教程

您现在的位置是:首页 >  系统

当前栏目

centos7升级ruby

centos7ruby 升级
2023-09-14 08:59:05 时间

升级ruby

一、安装rvm

1、下载rvm
yum install wget -y
cd download/
mkdir rvm && cd rvm
wget https://codeload.github.com/rvm/rvm/tar.gz/1.29.8

 

2、安装rvm
tar -zxvf rvm-1.29.8.tar.gz
cd rvm-1.29.8/
参考:https://blog.csdn.net/u014089832/article/details/108304838
./install --auto-dotfiles
激活rvm
source /etc/profile.d/rvm.sh
验证rvm
rvm -v
添加用户到组
usermod -aG rvm root

二、通过rvm升级ruby

安装 ruby。安装命令如下:
yum -y install ruby ruby-devel rubygems rpm-build

1、修改镜像源
修改 rvm下载 ruby的源,到 Ruby China 的镜像
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
参考:https://blog.csdn.net/Gushiyuta/article/details/90770681

2、查看rvm库中已知的ruby版本
rvm list known

3、安装一个ruby版本
rvm install 2.3.3

4、使用一个ruby版本
rvm use 2.3.3

5、设置默认版本
rvm use 2.3.3 --default

6、卸载一个已知版本
rvm remove 2.0.0

7、查看ruby版本
ruby --version


安装redis的组件

gem install redis