redis requires ruby version 2.2.2的解决方案

redis requires ruby version 2.2.2的解决方案

今天在做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/  [[email protected] ~]# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB 
  [[email protected] ~]# curl -sSL https://get.rvm.io | bash -s stable
  [[email protected] ~]# 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

  [[email protected] ~]# source /usr/local/rvm/scripts/rvm

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

   [[email protected] ~]# 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版本:

  [[email protected] ~]# 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/[email protected]
    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版本:

  [[email protected] ~]# rvm use 2.4.1

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

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

  [[email protected] ~]# rvm use 2.4.1 --default

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

6、卸载一个已知版本:

  [[email protected] ~]# rvm remove 2.3.4

7、查看ruby版本:

  [[email protected] ~]# ruby --version

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

8、安装redis:

  [[email protected] ~]# 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

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

原文地址:https://www.cnblogs.com/lykbk/p/sdfsdfdsf32e423234.html

时间: 2024-10-24 04:13:16

redis requires ruby version 2.2.2的解决方案的相关文章

redis requires Ruby version >= 2.2.2问题

一.说明: 搭建Redis集群时,安装 gem install redis 报错: redis requires Ruby version >= 2.2.2的报错,查了资料发现是Centos默认支持ruby到2.0.0,可gem 安装redis需要最低是2.2.2 二.解决办法: 解决办法是 先安装rvm,再把ruby版本提升至2.3.3 1.安装curl sudo yum install curl 2. 安装RVM curl -L get.rvm.io | bash -s stable 报错:

redis requires Ruby version >= 2.3.0.

最近在研究redis的集群,redis官方提供了redis-trib.rb工具,但是在使用之前 需要安装ruby,以及redis和ruby连接: yum -y install ruby ruby-devel rubygems rpm-build gem install redis 其中 gem install redis命令执行时出现了: Fetching: redis-4.1.2.gem (100%) ERROR: Error installing redis: redis requires

部署老系统出现的问题Gem::InstallError: net-ssh requires Ruby version >= 2.0

Gem::InstallError: net-ssh requires Ruby version >= 2.0 修改Gemfile,变一下版本 gem 'unicorn' group :test, :development do gem "rspec-rails", ">= 2.5.0" gem 'factory_girl', '2.6.4' gem 'factory_girl_rails', '1.7.0' gem 'faker', '1.1.2' g

cocoapods的安装 遇到 Error installing pods:activesupport requires Ruby version >=2.2.2

1.打开终端 2 移除现有 Ruby 默认源 输入以下指令 $gem sources --remove https://rubygems.org/ 3.使用新的源 输入以下指令 $gem sources -a https://ruby.taobao.org/ 4.验证新源是否替换成功 输入以下指令 $gem sources -l 5.安装 CocoaPods $sudo gem install cocoa pods //–––––––––––那么问题来了——没遇到的自动跳过———————————

iOS的CocoaPods(activesupport requires Ruby version >= 2.2.2)

如果你在安装遇到这个问题 activesupport requires Ruby version >= 2.2.2,那么这里可以帮助你(lasted version) 如果你是通过 http://www.cnblogs.com/pruple/p/5345084.html 安装的,在安装cocoapods遇到这个错,是因为ruby版本太低原因 ruby -v可查看当前版本,目前最新2.3.0,安装2.2.2版本及以上版本就可 1.关于更新ruby链接:http://blog.csdn.net/li

how to change the original ruby version in Rails app

The ruby version what I used need lower,changed, run $rvm use |rubyVersion| --default $cd |project| $bundle install finally, the ruby version what you use is changed.

RVM(ruby version manage)安装指南

一.安装需要3步gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \curl -sSL https://get.rvm.io | bash -s stable 退出后,重新登陆即可. RVM的基本命令: 列出已知的 Ruby 版本 rvm list known 安装一个 Ruby 版本 rvm install 2.3.3 --disable-binary 参考:htt

【QT】Installer requires Xcode Version 5.0.0 for Qt download if toolchain not found

When I install QT in MacOS 11.3.6, it prompts I need to install xcode then I install xcode but it was still fruitless. now, it's the solution: referrence: https://www.jianshu.com/p/5a6b7fcdf4c3 原文地址:https://www.cnblogs.com/kingdelee/p/10350864.html

Dynamic Web Module 3.1 requires Java 1.7 or newer. 错误解决方案

在写代码的时候工程出现了这样奇怪的bug很是蛋疼啊,经过查询解决方法,终于解决了这些个问题. 下面是解决问题的方法,和大家分享一下 (1)确定你的java工程配置使用了java 7 右键单击你的工程project > Properties > Java Compiler and set "Compiler compliance level" to 1.7 (2)选择Java Build Path. 按照下图点击 "Edit". 把JDK版本调到"