ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

使用RVM升级Linux Ruby版本

2021-03-03 11:00:24  阅读:206  来源: 互联网

标签:Ruby 2.7 gpg redis rvm RVM Linux root ruby


目录

1.主机环境如下

2.查看ruby版本

3.安装RVM

4.升级ruby版本至2.2.2版本以上


今天在搭建Redis集群时,在使用gem安装redis-4.1.0.gem包时,提示需要Ruby版本过低,需要大于2.2.2

[root@localhost redis-cluster]# gem install redis-4.1.0.gem 
ERROR:  Error installing redis-4.1.0.gem:
	redis requires Ruby version >= 2.2.2.

但是通过yum升级包,提示版本已经是最新的,但版本只有ruby 2.0.0p648

好家伙!我他妈直接好家伙!_好家伙_直接表情

网上搜索了一下,接下来使用rvm对ruby进行升级,对别人的步骤通过自己实践遇到的不同做了更新。

本文适用于  ruby:2.0.0p648   时间:2021年3月3日

1.主机环境如下

[root@localhost redis-cluster]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core) 
[root@localhost redis-cluster]# uname -r
3.10.0-957.el7.x86_64

2.查看ruby版本

[root@localhost redis-cluster]# ruby -v
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]

3.安装RVM

1)自行访问rvm官网,https://rvm.io/, 找到如下命令

2)在第一个命令中添加keyserver信息后执行,添加GPG key

[root@localhost redis-cluster]# gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF3E739499BDB
gpg: 下载密钥‘D39DC0E3’,从 hkp 服务器 keys.gnupg.net
gpg: 下载密钥‘39499BDB’,从 hkp 服务器 keys.gnupg.net
gpg: /root/.gnupg/trustdb.gpg:建立了信任度数据库
gpg: 密钥 D39DC0E3:公钥“Michal Papis (RVM signing) <mpapis@gmail.com>”已导入
gpg: 密钥 39499BDB:公钥“Piotr Kuczynski <piotr.kuczynski@gmail.com>”已导入
gpg: 没有找到任何绝对信任的密钥
gpg: 合计被处理的数量:2
gpg:           已导入:2  (RSA: 2)

3)然后继续执行第二个命令,安装RVM (Ruby Version Manager)

[root@localhost redis-cluster]# \curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
gpg: 于 2021年01月16日 星期六 02时46分22秒 CST 创建的签名,使用 RSA,钥匙号 39499BDB
gpg: 完好的签名,来自于“Piotr Kuczynski <piotr.kuczynski@gmail.com>”
gpg: 警告:这把密钥未经受信任的签名认证!
gpg:       没有证据表明这个签名属于它所声称的持有者。
主钥指纹: 7D2B AF1C F37B 13E2 069D  6956 105B D0E7 3949 9BDB
GPG verified '/usr/local/rvm/archives/rvm-1.29.12.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!
Thanks for installing RVM 

标签:Ruby,2.7,gpg,redis,rvm,RVM,Linux,root,ruby
来源: https://blog.csdn.net/sdujava2011/article/details/114300834

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有