• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

redis requires ruby version 2.2.2的解决方案 redis requires ruby version ...

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

   今天在做Redis的Cluster集群的时候,在执行gem install redis时,提示如下错误:

    gem install redis
    ERROR:  Error installing redis:
     redis requires Ruby version >= 2.2.2.


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

1、安装RVM(具体命令可以查看官网,Ruby官网地址 和 Ruby官网安装教程):

//具体RVM安装命令地址:http://rvm.io/
  [root@linux ~]# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

  [root@linux ~]# curl -sSL https://get.rvm.io | bash -s stable

  [root@linux ~]# find / -name rvm -print

     /usr/local/rvm
     /usr/local/rvm/src/rvm
     /usr/local/rvm/src/rvm/bin/rvm
     /usr/local/rvm/src/rvm/lib/rvm
     /usr/local/rvm/src/rvm/scripts/rvm
     /usr/local/rvm/bin/rvm
     /usr/local/rvm/lib/rvm
     /usr/local/rvm/scripts/rvm

  [root@linux ~]# source /usr/local/rvm/scripts/rvm


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

   [root@linux ~]# 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[.7]
    [ruby-]2.3[.4]
    [ruby-]2.4[.1]
    ruby-head
    ….

3、安装一个ruby版本:

  [root@linux ~]# rvm install 2.4.1

    Searching for binary rubies, this might take some time.
    Found remote file https://rvm_io.global.ssl.fastly.net/binaries/centos/7/x86_64/ruby-2.4.1.tar.bz2
    Checking requirements for centos.
    Requirements installation successful.
    ruby-2.4.1 - #configure
    ruby-2.4.1 - #download
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 14.1M  100 14.1M    0     0    97k      0  0:02:27  0:02:27 --:--:--  159k
    No checksum for downloaded archive, recording checksum in user configuration.
    ruby-2.4.1 - #validate archive
    ruby-2.4.1 - #extract
    ruby-2.4.1 - #validate binary
    ruby-2.4.1 - #setup
    ruby-2.4.1 - #gemset created /usr/local/rvm/gems/ruby-2.4.1@global
    ruby-2.4.1 - #importing gemset /usr/local/rvm/gemsets/global.gems..............................
    ruby-2.4.1 - #generating global wrappers........
    ruby-2.4.1 - #gemset created /usr/local/rvm/gems/ruby-2.4.1
    ruby-2.4.1 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
    ruby-2.4.1 - #generating default wrappers........


4、使用一个ruby版本:

  [root@linux ~]# rvm use 2.4.1

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


5、设置默认版本:(设置ruby2.4.1为默认的ruby,因为还安装有1.8.3)

  [root@linux ~]# rvm use 2.4.1 --default

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


6、卸载一个已知版本:

  [root@linux ~]# rvm remove 2.3.4


7、查看ruby版本:

  [root@linux ~]# ruby --version

      ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]


8、安装redis:

  [root@linux ~]# gem install redis

    Fetching: redis-4.0.1.gem (100%)
    Successfully installed redis-4.0.1
    Parsing documentation for redis-4.0.1
    Installing ri documentation for redis-4.0.1
    Done installing documentation for redis after 3 seconds
    1 gem installed


     问题解决,不错,过了年就解决了一个问题,还是值得庆祝的。

天下国家,可均也;爵禄,可辞也;白刃,可蹈也;中庸不可能也

   今天在做Redis的Cluster集群的时候,在执行gem install redis时,提示如下错误:

    gem install redis
    ERROR:  Error installing redis:
     redis requires Ruby version >= 2.2.2.


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

1、安装RVM(具体命令可以查看官网,Ruby官网地址 和 Ruby官网安装教程):

//具体RVM安装命令地址:http://rvm.io/
  [root@linux ~]# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

  [root@linux ~]# curl -sSL https://get.rvm.io | bash -s stable

  [root@linux ~]# find / -name rvm -print

     /usr/local/rvm
     /usr/local/rvm/src/rvm
     /usr/local/rvm/src/rvm/bin/rvm
     /usr/local/rvm/src/rvm/lib/rvm
     /usr/local/rvm/src/rvm/scripts/rvm
     /usr/local/rvm/bin/rvm
     /usr/local/rvm/lib/rvm
     /usr/local/rvm/scripts/rvm

  [root@linux ~]# source /usr/local/rvm/scripts/rvm


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

   [root@linux ~]# 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[.7]
    [ruby-]2.3[.4]
    [ruby-]2.4[.1]
    ruby-head
    ….

3、安装一个ruby版本:

  [root@linux ~]# rvm install 2.4.1

    Searching for binary rubies, this might take some time.
    Found remote file https://rvm_io.global.ssl.fastly.net/binaries/centos/7/x86_64/ruby-2.4.1.tar.bz2
    Checking requirements for centos.
    Requirements installation successful.
    ruby-2.4.1 - #configure
    ruby-2.4.1 - #download
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 14.1M  100 14.1M    0     0    97k      0  0:02:27  0:02:27 --:--:--  159k
    No checksum for downloaded archive, recording checksum in user configuration.
    ruby-2.4.1 - #validate archive
    ruby-2.4.1 - #extract
    ruby-2.4.1 - #validate binary
    ruby-2.4.1 - #setup
    ruby-2.4.1 - #gemset created /usr/local/rvm/gems/ruby-2.4.1@global
    ruby-2.4.1 - #importing gemset /usr/local/rvm/gemsets/global.gems..............................
    ruby-2.4.1 - #generating global wrappers........
    ruby-2.4.1 - #gemset created /usr/local/rvm/gems/ruby-2.4.1
    ruby-2.4.1 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
    ruby-2.4.1 - #generating default wrappers........


4、使用一个ruby版本:

  [root@linux ~]# rvm use 2.4.1

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


5、设置默认版本:(设置ruby2.4.1为默认的ruby,因为还安装有1.8.3)

  [root@linux ~]# rvm use 2.4.1 --default

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


6、卸载一个已知版本:

  [root@linux ~]# rvm remove 2.3.4


7、查看ruby版本:

  [root@linux ~]# ruby --version

      ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]


8、安装redis:

  [root@linux ~]# gem install redis

    Fetching: redis-4.0.1.gem (100%)
    Successfully installed redis-4.0.1
    Parsing documentation for redis-4.0.1
    Installing ri documentation for redis-4.0.1
    Done installing documentation for redis after 3 seconds
    1 gem installed


     问题解决,不错,过了年就解决了一个问题,还是值得庆祝的。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
在Editplus中搭建Ruby开发环境发布时间:2022-07-13
下一篇:
windows7下安装gem包---bcrypt-ruby发布时间:2022-07-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap