本文更新于2021-11-03,使用Redis 4.0.8,作業系統為CentOS 7.5,
-
CentOS 7下直接運行
redis-trib.rb可能出現如下提示,原因是沒有安裝Ruby:/usr/bin/env: ruby: No such file or directory
-
安裝Ruby,
yum install ruby -
安裝Ruby包管理器,
yum install rubygems -
通過Ruby包管理器安裝Redis模塊,
gem install redis可能出現如下提示,原因是Ruby版本過低:
ERROR: Error installing redis:
redis requires Ruby version >= 2.4.0. -
使用RMV(Ruby版本管理器)安裝高版本Ruby,
-
安裝RVM,官方檔案見:https://rvm.io/,
\curl -sSL https://get.rvm.io | bash -s stable可能出現如下提示,原因是未安裝公鑰:
Warning, RVM 1.29.12 introduces signed releases and automated check of signatures when GPG software found.
Assuming you trust Michal Papis import the mpapis public key (downloading the signatures).
GPG signature verification failed for '/home/tigergm/.rvm/archives/rvm-1.29.7.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.7/1.29.7.tar.gz.asc'! Try to install GPG v2 and then fetch the public key:
gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or if it fails:
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
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如失敗改為運行:
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -然后再次運行:
\curl -sSL https://get.rvm.io | bash -s stable -
使RVM立即生效,
source /usr/local/rvm/scripts/rvm -
查看RVM庫中的Ruby版本,
rvm list known -
安裝指定版本的Ruby(此處安裝2.4.1,可根據需要選擇),
rvm install 2.4.1 -
切換Ruby默認版本,
rvm use 2.4.1 --default -
查看Ruby版本,
ruby --version
-
-
重新通過Ruby包管理器安裝Redis模塊,
gem install redis -
重新運行
redis-trib.rb,
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/347040.html
標籤:其它
上一篇:動力節點JDBC從入門到精通視頻教程,建議收藏!非常全面
下一篇:SQL 算術運算子和比較運算子
