解決redis requires ruby version 2.3.0


CentOS7 yum庫中ruby的版本支持到 2.0.0,但是gem安裝redis需要最低是2.3.0,采用rvm來更新ruby

1.安裝curl

yum -y install curl

2.安裝rvm

  1. gpg2 --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
  2.   curl -L get.rvm.io | bash -s stable

遇到以下報錯

  1.   [ root@localhost ~]# curl -L get.rvm.io | bash -s stable
  2.      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
  3.                                     Dload  Upload   Total   Spent    Left  Speed
  4.   100   194  100   194    0     0    242      0 --:--:-- --:--:-- --:--:--   242
  5.   100 24168  100 24168    0     0  10201      0  0:00:02  0:00:02 --:--:-- 42474
  6.   Downloading https://github.com/rvm/rvm/archive/1.29.8.tar.gz
  7.   Downloading https://github.com/rvm/rvm/releases/download/1.29.8/1.29.8.tar.gz.asc
  8.   gpg: 2019年05月08日 星期三 22時14分49秒 CST 創建的簽名,使用 RSA,鑰匙號 39499BDB
  9.   gpg: 無法檢查簽名:沒有公鑰
  10.   GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.29.8.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.8/1.29.8.tar.gz.asc'! Try to install GPG v2 and then fetch the public key:
  11.   
  12.        gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
  13.  
  14.   or if it fails:
  15.   
  16.        command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
  17.        command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
  18.  
  19.   In case of further problems with validation please refer to https://rvm.io/rvm/security

根據上面提示,安裝前先執行

gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

3.修改 rvm下載 ruby的源,到 Ruby China 的鏡像

gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/

4.查看rvm庫中已知的ruby版本

rvm list known

5.安裝一個ruby版本

rvm install 2.3.3

6. 使用一個ruby版本

rvm use 2.3.3

7.設置默認版本

rvm use 2.3.3 --default

8.卸載一個已知版本

rvm remove 2.0.0

9.查看ruby版本

ruby --version


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM