Redis集群环境Ruby必须版本2.2以上解决
【摘要】
Redis集群环境中需要ruby环境,执行gem install redis时,提示如下错误:
[root@hadoop-node01 src]# gem install redis
ERROR: E...
Redis集群环境中需要ruby环境,执行gem install redis时,提示如下错误:
[root@hadoop-node01 src]# gem install redis
ERROR: Error installing redis:
redis requires Ruby version >= 2.2.2.
- 1
- 2
- 3
在centOS中yum源中对ruby的支持版本为2.0.0,可gem 安装redis需要最低是2.2.2,采用rvm来更新ruby
1.安装RVM
[root@hadoop-node01 ~]# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A
1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
[root@hadoop-node01 ~]# curl -sSL https://get.rvm.io | bash -s stable
[root@hadoop-node01 ~]# find / -name rvm -print
- 1
- 2
- 3
- 4
- 5
- 6
在执行curl命令的时候有可能报错如下:
[root@hadoop-node01 ~]# curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/.tar.gz
curl: (35) SSL connect error
Could not download 'https://github.com/rvm/rvm/archive/.tar.gz'.
curl returned status '35'.
Downloading https://bitbucket.org/mpapis/rvm/get/.tar.gz
curl: (35) SSL connect error
Could not download 'https://bitbucket.org/mpapis/rvm/get/.tar.gz'.
curl returned status '35'.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
无法在服务器使用curl命令访问https域名,原因是nss版本有点旧了,yum -y update nss更新一下,重新curl即可!
命令执行完成后的输出结果
[root@hadoop-node01 ~]# find / -name rvm -print
/usr/local/rvm
/usr/local/rvm/scripts/rvm
/usr/local/rvm/lib/rvm
/usr/local/rvm/bin/rvm
/usr/local/rvm/src/rvm
/usr/local/rvm/src/rvm/scripts/rvm
/usr/local/rvm/src/rvm/lib/rvm
/usr/local/rvm/src/rvm/bin/rvm
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
加载文件
[root@hadoop-node01 ~]# source /usr/local/rvm/scripts/rvm
- 1
2.查看rvm库中已知的ruby版本
[root@hadoop-node01 ~]# rvm list known
- 1
[root@hadoop-node01 ~]# rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.5]
[ruby-]2.5[.3]
[ruby-]2.6[.0]
ruby-head
~
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
3.安装一个ruby版本
[root@hadoop-node01 ~]# rvm install 2.4.5
- 1
4.使用一个ruby版本
[root@hadoop-node01 ~]# rvm use 2.4.5
Using /usr/local/rvm/gems/ruby-2.4.5
- 1
- 2
5.设置默认版本
[root@hadoop-node01 ~]# rvm use 2.4.5 --default
Using /usr/local/rvm/gems/ruby-2.4.5
- 1
- 2
6.卸载一个已知版本
[root@hadoop-node01 ~]# rvm remove 2.4.5
- 1
7.查看ruby版本
[root@hadoop-node01 ~]# ruby --version
ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]
- 1
- 2
文章来源: dpb-bobokaoya-sm.blog.csdn.net,作者:波波烤鸭,版权归原作者所有,如需转载,请联系作者。
原文链接:dpb-bobokaoya-sm.blog.csdn.net/article/details/87220510
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)