redis requires Ruby version >= 2.2.2

在安装redis集群时遇到了redis requires Ruby version >= 2.2.2
现在需要安装ruby2.2.2以上版本
安装RVM(具体命令可以查看官网,Ruby官网地址 和 Ruby官网安装教程):

[root@localhost ~]# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB 
[root@localhost ~]# curl -sSL https://get.rvm.io | bash -s stable
具体可去官网查询
执行
[root@localhost ~]# source /usr/local/rvm/scripts/rvm

查询rvm库中已知的ruby版本

[root@localhost ~]# rvm list known
[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[.6]
[ruby-]2.5[.5]
[ruby-]2.6[.3]

我们安装2.6.3版本

[root@localhost ~]# rvm install 2.6.3
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/7/x86_64/ruby-2.6.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Installing requirements for centos.
Installing required packages: libffi-devel, readline-devel, sqlite-devel, zlib-devel, openssl-devel......................
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.6.3, this may take a while depending on your cpu(s)...
ruby-2.6.3 - #downloading ruby-2.6.3, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.8M  100 13.8M    0     0   541k      0  0:00:26  0:00:26 --:--:--  828k
ruby-2.6.3 - #extracting ruby-2.6.3 to /usr/local/rvm/src/ruby-2.6.3.....
ruby-2.6.3 - #configuring......................................................................
ruby-2.6.3 - #post-configuration..
ruby-2.6.3 - #compiling................................................................................................
ruby-2.6.3 - #installing................................
ruby-2.6.3 - #making binaries executable..
Rubygems 3.0.3 already available in installed ruby, skipping installation, use --force to reinstall.
ruby-2.6.3 - #gemset created /usr/local/rvm/gems/ruby-2.6.3@global
ruby-2.6.3 - #importing gemset /usr/local/rvm/gemsets/global.gems................................................................
ruby-2.6.3 - #generating global wrappers.......
ruby-2.6.3 - #gemset created /usr/local/rvm/gems/ruby-2.6.3
ruby-2.6.3 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.6.3 - #generating default wrappers.......
ruby-2.6.3 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.6.3 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri

安装成功

使用ruby版本

 [root@localhost ~]# rvm use 2.6.3
  设置成默认版本
 [root@localhost ~]#rvm use 2.6.3 --default

安装redis

[root@localhost ~]# gem install redis      
Fetching redis-4.1.1.gem
Successfully installed redis-4.1.1
Parsing documentation for redis-4.1.1
Installing ri documentation for redis-4.1.1
Done installing documentation for redis after 1 seconds
1 gem installed

你可能感兴趣的:(redis requires Ruby version >= 2.2.2)