ITPub博客

首页 > 数据库 > 数据库开发技术 > 解决redis requires ruby version 2.3.0报错

解决redis requires ruby version 2.3.0报错

原创 数据库开发技术 作者:pingdanorcale 时间:2020-08-27 11:42:23 0 删除 编辑

 最近安装redis cluster 报如下错误:

 CentOS7 yum库中ruby的版本支持到 2.0.0,但是gem安装redis需要最低是2.3.0,采用rvm来更新ruby

Complete!

[root@reds src]# gem install redis

Fetching: redis-4.2.1.gem (100%)

ERROR:  Error installing redis:

        redis requires Ruby version >= 2.3.0.

1.安装curl

yum -y install curl

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

 * base: mirror.bit.edu.cn

 * centos-sclo-rh: mirror.bit.edu.cn

 * centos-sclo-sclo: mirror.bit.edu.cn

 * extras: mirror.bit.edu.c


[root@reds src]# curl -L get.rvm.io | bash -s stable

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   194  100   194    0     0     37      0  0:00:05  0:00:05 --:--:--    53

curl: (7) Failed connect to raw.githubusercontent.com:443; Connection refused


修改hosts

 vi /etc/hosts

添加如下内容:

199.232.28.133 raw.githubusercontent.com


 curl -L get.rvm.io | bash -s stable   

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   194  100   194    0     0    159      0  0:00:01  0:00:01 --:--:--   159

100 24535  100 24535    0     0   7803      0  0:00:03  0:00:03 --:--:-- 22324

Downloading

Downloading

gpg: Signature made Thu 26 Mar 2020 05:58:42 AM CST using RSA key ID 39499BDB

gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>"

gpg: WARNING: This key is not certified with a trusted signature!

gpg:          There is no indication that the signature belongs to the owner.

Primary key fingerprint: 7D2B AF1C F37B 13E2 069D  6956 105B D0E7 3949 9BDB

GPG verified '/usr/local/rvm/archives/rvm-1.29.10.tgz'

Upgrading the RVM installation in /usr/local/rvm/

Upgrade of RVM in /usr/local/rvm/ is complete.

  * 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 

Please consider donating to our open collective to help us maintain RVM.


  Donate:

说明安装成功。


在 /usr/local/rvm/


 rvm install 2.3.0




Searching for binary rubies, this might take some time.

No binary rubies available for: centos/7/x86_64/ruby-2.3.0.

Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.

Checking requirements for centos.

Requirements installation successful.

Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu(s)...

ruby-2.3.0 - #downloading ruby-2.3.0, 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.5M  100 13.5M    0     0  36729      0  0:06:26  0:06:26 --:--:-- 45245

ruby-2.3.0 - #extracting ruby-2.3.0 to /usr/local/rvm/src/ruby-2.3.0.....

ruby-2.3.0 - #applying patch /usr/local/rvm/patches/ruby/ruby_2_3_gcc7.patch.

ruby-2.3.0 - #applying patch /usr/local/rvm/patches/ruby/changeset_r53419.diff.

ruby-2.3.0 - #applying patch /usr/local/rvm/patches/ruby/2.3.0/random_c_using_NR_prefix.patch.

ruby-2.3.0 - #configuring..........................................................

ruby-2.3.0 - #post-configuration..

ruby-2.3.0 - #compiling.......................................................-

...........................

ruby-2.3.0 - #installing............................

ruby-2.3.0 - #making binaries executable..

ruby-2.3.0 - #downloading rubygems-3.0.8

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

 13  867k   13  115k    0     0   4373      0  0:03:23  0:00:26  0:02:57  5952


 60  867k   60  520k    0     0   5296      0  0:02:47  0:01:40  0:01:07  7883

 62  867k   62  539k    0     0   5344      0  0:02:46  0:01:43  0:01:03  7513

100  867k  100  867k    0     0   6812      0  0:02:10  0:02:10 --:--:-- 10870

No checksum for downloaded archive, recording checksum in user configuration.

ruby-2.3.0 - #extracting rubygems-3.0.8.....

ruby-2.3.0 - #removing old rubygems........

ruby-2.3.0 - #installing rubygems-3.0.8................................................................

ruby-2.3.0 - #gemset created /usr/local/rvm/gems/ruby-2.3.0@global

ruby-2.3.0 - #importing gemset /usr/local/rvm/gemsets/global.gems................................................................

ruby-2.3.0 - #generating global wrappers.......

ruby-2.3.0 - #gemset created /usr/local/rvm/gems/ruby-2.3.0

ruby-2.3.0 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list

ruby-2.3.0 - #generating default wrappers.......

ruby-2.3.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).

Install of ruby-2.3.0 - #complete 

Please be aware that you just installed a ruby that requires 3 patches just to be compiled on an up to date linux system.

This may have known and unaccounted for security vulnerabilities.

Please consider upgrading to ruby-2.7.0 which will have all of the latest security patches.

Ruby was built without documentation, to build it run: rvm docs generate-ri

[root@reds bin]# 

[root@reds bin]# rvm use 2.3.3

Required ruby-2.3.3 is not installed.

To install do: 'rvm install "ruby-2.3.3"'

[root@reds bin]# rvm use 2.3.3 --default

Required ruby-2.3.3 is not installed.

To install do: 'rvm install "ruby-2.3.3"'

[root@reds bin]# rvm remove 2.0.0

ruby-2.0.0-p648 - #already gone

Using /usr/local/rvm/gems/ruby-2.3.0

[root@reds bin]# ruby --version

ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10201716/viewspace-2714960/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-01-02

  • 博文量
    58
  • 访问量
    110898