gem install redis报错解决

Posted quicksand.F

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gem install redis报错解决相关的知识,希望对你有一定的参考价值。

在执行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/[email protected]
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报错解决的主要内容,如果未能解决你的问题,请参考以下文章

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

gem install报错 ruby升级

关于ruby安装在windows gem install redis-dump 报错:MSYS2 could not be found

Mac 运行 gem install 报错 cannot load such file -- openssl

redis-trib.rb创建Redis集群时失败报错解决方案

./redis-trib.rb 报错:/usr/local/rvm/gems/ruby-2.4.2/gems/redis-4.0.1/lib/redis/client.rb:119:in `call&