redis requires Ruby version >= 2.3.0.
最近在研究redis的集群,redis官方提供了redis-trib.rb工具,但是在使用之前 需要安装ruby,以及redis和ruby连接:
yum -y install ruby ruby-devel rubygems rpm-build
gem install redis
其中 gem install redis命令执行时出现了:
1 2 3 | Fetching: redis-4.1.2.gem (100%) ERROR: Error installing redis: redis requires Ruby version >= 2.3.0. |
查了资料发现是Centos默认支持ruby到2.0.0,可gem 安装redis需要最低是2.3.0
解决办法是 先安装rvm,再把ruby版本提升至2.3.0
1.安装curl
yum install curl
2. 安装RVM
curl -L get.rvm.io | bash -s stable #看报错提示Downloading https://github.com/rvm/rvm/archive/1.29.8.tar.gz
1 2 3 4 5 6 7 8 9 10 11 12 | <em id = "__mceDel" >Downloading https: //github .com /rvm/rvm/releases/download/1 .29.8 /1 .29.8. tar .gz.asc gpg: Signature made Wed 08 May 2019 10:14:49 PM CST using RSA key ID 39499BDB gpg: Can't check signature: No public key 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: 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 -<br> < /em > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | [root@ ~] # curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - gpg: keyring ` /root/ .gnupg /secring .gpg' created gpg: /root/ .gnupg /trustdb .gpg: trustdb created gpg: key D39DC0E3: public key "Michal Papis (RVM signing) <mpapis@gmail.com>" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) gpg: no ultimately trusted keys found [root@ ~] # curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import - gpg: key 39499BDB: public key "Piotr Kuczynski <piotr.kuczynski@gmail.com>" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) [root@ ~] # curl -L get.rvm.io | bash -s stable % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 194 100 194 0 0 277 0 --:--:-- --:--:-- --:--:-- 277 100 24168 100 24168 0 0 6932 0 0:00:03 0:00:03 --:--:-- 16690 Downloading https: //github .com /rvm/rvm/archive/1 .29.8. tar .gz Downloading https: //github .com /rvm/rvm/releases/download/1 .29.8 /1 .29.8. tar .gz.asc gpg: Signature made Wed 08 May 2019 10:14:49 PM CST using RSA key ID 39499BDB gpg: Good signature from "Piotr Kuczynski <piotr.kuczynski@gmail.com>" gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 7D2B AF1C F37B 13E2 069D 6956 105B D0E7 3949 9BDB GPG verified '/usr/local/rvm/archives/rvm-1.29.8.tgz' Creating group 'rvm' Installing RVM to /usr/local/rvm/ Installation of RVM in /usr/local/rvm/ is almost complete: * First you need to add all users that will be using rvm to 'rvm' group, and logout - login again, anyone using rvm will be operating with ` umask u=rwx,g=rwx,o=rx`. * To start using RVM you need to run ` source /etc/profile .d /rvm .sh` in all your open shell windows, in rare cases you need to reopen all shell windows. * Please do NOT forget to add your users to the rvm group. The installer no longer auto-adds root or users to the rvm group. Admins must do this. Also, please note that group memberships are ONLY evaluated at login time . This means that users must log out then back in before group membership takes effect! Thanks for installing RVM 🙏 Please consider donating to our open collective to help us maintain RVM. 👉 Donate: https: //opencollective .com /rvm/donate |
1 2 3 4 5 | [root@ ~] # find / -name rvm.sh /etc/profile .d /rvm .sh [root@ ~] # source /etc/profile.d/rvm.sh [root@ ~] # rvm requirements [root@ ~] # rvmsudo yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel |
3. source /usr/local/rvm/scripts/rvm
4. 查看rvm库中已知的ruby版本
rvm list known
5. 安装一个ruby版本
rvm install 2.3.3
6. 使用一个ruby版本
rvm use 2.3.3
7. 设置默认版本
rvm remove 2.0.0
8. 卸载一个已知版本
ruby --version
9. 再安装redis就可以了
gem install redis
posted on 2019-06-10 11:54 狂奔中社会主义酸菜 阅读(2704) 评论(0) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!