在执行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,自己编译的ruby源码,再执行还是报错…最后google结合几篇文章解决了:
采用rvm来更新ruby:
1.安装RVM:
    gpg2 --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
    curl -L get.rvm.io | bash -s stable
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
   
#source /usr/local/rvm/scripts/rvm
2.查看rvm库中已知的ruby版本
#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[.6]
[ruby-]2.3[.3]
[ruby-]2.4[.0]
ruby-head
….
3.安装一个ruby版本
#rvm install 2.3.3
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.3.3 - #extracting rubygems-2.6.12….
ruby-2.3.3 - #removing old rubygems………
ruby-2.3.3 - #installing rubygems-2.6.12…………………….
ruby-2.3.3 - #gemset created /usr/local/rvm/gems/ruby-2.3.3@global
ruby-2.3.3 - #importing gemset /usr/local/rvm/gemsets/global.gems…………..|
ruby-2.3.3 - #generating global wrappers……..
ruby-2.3.3 - #gemset created /usr/local/rvm/gems/ruby-2.3.3
ruby-2.3.3 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.3 - #generating default wrappers……..
ruby-2.3.3 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.3 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
4.使用一个ruby版本
rvm use 2.3.3
Using /usr/local/rvm/gems/ruby-2.3.3
[5].设置默认版本
rvm use 2.3.3 --default
Using /usr/local/rvm/gems/ruby-2.3.3
[6].卸载一个已知版本
rvm remove 2.0.0
查看ruby版本:
ruby --version
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
安装redis:
gem install redis
Fetching: redis-4.0.0.gem (100%)
Successfully installed redis-4.0.0
Parsing documentation for redis-4.0.0
Installing ri documentation for redis-4.0.0
Done installing documentation for redis after 1 seconds
1 gem installed

gem install redis报错解决的更多相关文章

  1. 解决方法:配置群集时# gem install redis 报错:Unable to require openssl, install OpenSSL and rebuild ruby

    问题:前面已经在/usr/local/src安装了ruby-2.3.0.tar.gz.rubygems-2.4.2.tar.gz.在配置 redis-3.1.1 群集中,使用gem install 安 ...

  2. 安装Redis-cluster-gem install redis报错的解决方案

    错误描述: [root@eshop-cache01 local]# gem install redis ERROR: Loading command: install (LoadError) cann ...

  3. mac brew install redis 报错

    mac brew install redis 报错 /usr/local/opt/php55/bin/phpize /usr/local/opt/php55/bin/phpize: line 61: ...

  4. redis报错解决

    1.Connecting to node 127.0.0.17000 [ERR] Sorry, can't connect to node 192.168.1.917000 redis集群:Conne ...

  5. Gem install rmagick 报错问题~

    本人在CentOS7上在 执行”gem install rmagick“是报错,具体情况如下: 报错如下: [root@localhost ~]# gem install rmagick -v '2. ...

  6. pip install win32api报错解决方法

    在安装pywinauto模块,导入模块后,提示缺少:win32api 但是在使用pip install安装win32api后,居然报错 错误信息如下: Could not find a version ...

  7. Python中pip install MySQL-python报错解决方法

    环境 Centos 7(其他Centos或者RHEL一样) 问题 在执行 pip install MySQL-python 时报错如: Command "python setup.py eg ...

  8. pip install RISE报错解决

    ERROR: Cannot uninstall 'tornado' ERROR: Cannot uninstall 'tornado'. It is a distutils installed pro ...

  9. pip install mysql_python报错解决办法

    首先请注意,mysql_python只支持Python2,所以假如你是python3,就直接用python-connector去吧.下面这一条命令就可以了 pip install mysql-conn ...

随机推荐

  1. .net下4款不错的微信SDK

    .net下4款不错的微信SDK: 一款值得推荐的.Net微信开发SDK http://www.17ky.net/soft/474.html.Net微信公开帐号接口 WeiXinSDK http://w ...

  2. jquery的ajax post 方法传值到后台,无法通过HttpServletRequest得到

    今天通过$.ajax({type:"post"});和$.post()方法传值到后台,发现servelet通过HttpServletRequest无法获取到值,但通过get方法却可 ...

  3. my.cnf配置优化

    MYSQL服务器my.cnf配置文档详解硬件:内存16G[client] port = 3306 socket = /data/3306/mysql.sock [mysql] no-auto-reha ...

  4. 《TensorFlow实战》读书笔记(完结)

    1 TensorFlow基础 ---1.1TensorFlow概要 TensorFlow使用数据流图进行计算,一次编写,各处运行. ---1.2 TensorFlow编程模型简介 TensorFlow ...

  5. centos7系统初始化

    echo "# swappiness=0的时候表示最大限度使用物理内存,然后才是 swap空间" >> /etc/sysctl.conf echo -e "v ...

  6. 图解SQL的inner join、left join、right join、full outer join、union、union all的区别【转载】

    对于SQL的Join,在学习起来可能是比较乱的.我们知道,SQL的Join语法有很多inner的,有outer的,有left的,有时候,对于Select出来的结果集是什么样子有点不是很清楚.Codin ...

  7. OK335xS Linux Qt make: icpc: Command not found

    OK335xS Linux Qt make: icpc: Command not found 一.出错现象: make: icpc: Command not found make: *** [main ...

  8. android_serialport_api hacking

    /************************************************************************************ * * android_se ...

  9. 轻松制作儿童趣味算术软件 - imsoft.cnblogs

    轻松制作儿童趣味算术软件 马震安 电脑爱好者 2014-07-23 08:38技巧 0 条评论 标签:软件   兴趣是学习的动力,以动感的软件和自动判断得分的形式测试孩子的算术能力,总要比在白纸上出几 ...

  10. 写个简单的chrome插件-京东商品历史价格查询

    说chrome插件编写的先关文章, 首推小茗的[干货]Chrome插件(扩展)开发全攻略. 有非常完善的理论,引用和demo代码. 但是还是建议看官方的 chrome extensions. chro ...