Solve ruby Installation Problems: redis requires Ruby version & amp; amp, rubyredis

Source: Internet
Author: User
Tags redis cluster install redis

Solve ruby Installation Problems: redis requires Ruby version & amp, rubyredis
I. Problem Description

Today, we set up a redis cluster and encountered a problem when installing ruby and redis interface programs: redis requires Ruby version> = 2.2.2., as shown below:

[root@localhost ~]# gem install redis-4.0.0.gem ERROR:  Error installing redis-4.0.0.gem:        redis requires Ruby version >= 2.2.2. 
Ii. Cause

This is because the Centos7 yum Library only supports ruby version 2.0, but the interface program between ruby and redis needs to be installed later than 2.2, so an error is reported.

[root@localhost ~]# ruby -vruby 2.0.0p648 (2015-12-16) [x86_64-linux] 
Iii. Solution

First install rvm and then upgrade ruby to 2.3.3

1. Install rvm (just enter the following command)
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3curl -L get.rvm.io | bash -s stablesource /usr/local/rvm/scripts/rvm 

If curl is not installed, install curl first.

[root@localhost ~]# sudo yum install curl
2. Install the new version
[root@localhost ~]# rvm install 2.3.3
3. The new version is used by default.
[root@localhost ~]# rvm use 2.3.3 --defaultUsing /usr/local/rvm/gems/ruby-2.3.3
4. Uninstall the old version
[root@localhost ~]# rvm remove 2.0.0ruby-2.0.0-p648 - #already goneUsing /usr/local/rvm/gems/ruby-2.3.3
5. Check the ruby version again.
[root@localhost ~]# ruby -vruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
6. You can install the interface program between ruby and redis.
[root@localhost ~]# gem install redis-4.0.0.gemSuccessfully installed redis-4.0.0Parsing documentation for redis-4.0.0Installing ri documentation for redis-4.0.0Done installing documentation for redis after 1 seconds1 gem installed 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.