当前位置: 首页 > news >正文

肇庆企业网站关键词优化教程织梦教程网

肇庆企业网站关键词优化教程,织梦教程网,重庆网站建设开发,文件打开一堆乱码背景说明 在redis的5.0版本之前,使用redis提供的redis-trib创建redis集群时还需要依赖ruby环境。当然有时候我们自已也需要安装指定ruby版本环境。下面是安装时的大致过程,以及过程中遇到的问题解决。我使用的环境是centos7,小版本差别应该不…

背景说明

在redis的5.0版本之前,使用redis提供的redis-trib创建redis集群时还需要依赖ruby环境。当然有时候我们自已也需要安装指定ruby版本环境。下面是安装时的大致过程,以及过程中遇到的问题解决。我使用的环境是centos7,小版本差别应该不是很大,具体请自行测试。

安装

先安装ruby

#安装ruby环境
[root@k8s-m1 redis]# yum install ruby 
......
#gem是ruby的包管理工具,该命令可以安装ruby-redis依赖
[root@k8s-m1 redis]# gem install redis
Fetching: connection_pool-2.4.1.gem (100%)
ERROR:  Error installing redis:
connection_pool requires Ruby version >= 2.5.0.

可以看到在使用gem安装ruby-redis的依赖时,出现了报错。需要Ruby版本大于2.5.0。

安装rvm

先安装rvm,通过rvm来安装所需版本的ruby

# 确认自己环境的ruby版本确实低于2.5.0
[root@k8s-m1 ~]# ruby --version
ruby 2.0.0p648 (2015-12-16) [x86_64-linux] [root@k8s-m1 ~]# curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
gpg: Signature made Sat 16 Jan 2021 02:46:22 AM 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.12.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc'! Try to install GPG v2 and then fetch the public key:gpg2 --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDBor 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# 上面在下载安装时有报错,在返回的结果中有说明尝试方法,我选用的最后一个
[root@k8s-m1 ~]# 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@k8s-m1 ~]# curl -sSL https://get.rvm.io | bash -s stable^C
[root@k8s-m1 ~]#  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)

导入相应的key后再进行尝试安装,可以正常安装

[root@k8s-m1 ~]# curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
curl: (52) Empty reply from serverCould not download 'https://github.com/rvm/rvm/archive/1.29.12.tar.gz'.curl returned status '52'.Downloading https://bitbucket.org/mpapis/rvm/get/1.29.12.tar.gz
Downloading https://bitbucket.org/mpapis/rvm/downloads/1.29.12.tar.gz.asc
gpg: Signature made Sat 16 Jan 2021 02:46:26 AM 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.12.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 [0m
Please consider donating to our open collective to help us maintain RVM.Donate: https://opencollective.com/rvm/donate[root@k8s-m1 ~]# source  /usr/local/rvm/scripts/rvm # 查看rvm库中已知的ruby版本
[root@k8s-m1 ~]# 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[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.10]
[ruby-]2.5[.8]
[ruby-]2.6[.6]
[ruby-]2.7[.2]
[ruby-]3[.0.0]
ruby-head
......
# 此处省略了很多信息

安装指定ruby版本

从上可以看到支持安装很多版本的ruby版本,起初我直接安装的2.5.8版本,后续安装依赖时会报如下的错误。所以我重新安装了ruby3.0版本。各位不信邪的话可以自行尝试。

[root@k8s-m1 ~]# gem install redis
Fetching connection_pool-2.4.1.gem
Fetching redis-client-0.21.1.gem
Fetching redis-5.1.0.gem
Successfully installed connection_pool-2.4.1
ERROR:  Error installing redis:The last version of redis-client (>= 0.17.0) to support your Ruby & RubyGems was 0.19.1. Try installing it with `gem install redis-client -v 0.19.1` and then running the current command againredis-client requires Ruby version >= 2.6.0. The current ruby version is 2.5.8.224.

安装3.0版本

[root@k8s-m1 ~]# rvm install 3.0
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/7/x86_64/ruby-3.0.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-3.0.0, this may take a while depending on your cpu(s)...
ruby-3.0.0 - #downloading ruby-3.0.0, this may take a while depending on your connection...% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100 18.6M  100 18.6M    0     0   393k      0  0:00:48  0:00:48 --:--:-- 1215k
ruby-3.0.0 - #extracting ruby-3.0.0 to /usr/local/rvm/src/ruby-3.0.0.....
ruby-3.0.0 - #configuring.........................................................................
ruby-3.0.0 - #post-configuration..
ruby-3.0.0 - #compiling............................................................................................
ruby-3.0.0 - #installing....................................
ruby-3.0.0 - #making binaries executable...
Installed rubygems 3.2.3 is newer than 3.0.9 provided with installed ruby, skipping installation, use --force to force installation.
ruby-3.0.0 - #gemset created /usr/local/rvm/gems/ruby-3.0.0@global
ruby-3.0.0 - #importing gemset /usr/local/rvm/gemsets/global.gems................................................................
ruby-3.0.0 - #generating global wrappers........
ruby-3.0.0 - #gemset created /usr/local/rvm/gems/ruby-3.0.0
ruby-3.0.0 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-3.0.0 - #generating default wrappers........
ruby-3.0.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-3.0.0 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri

设置使用默认版本

# 使用一个ruby版本
[root@k8s-m1 ~]# rvm use 3.0
Using /usr/local/rvm/gems/ruby-3.0.0
# 可选择移除之前的版本
[root@k8s-m1 ~]# rvm remove 2.5.8
ruby-2.5.8 - #removing rubies/ruby-2.5.8..
ruby-2.5.8 - #removing gems....
ruby-2.5.8 - #removing aliases
ruby-2.5.8 - #removing wrappers....
ruby-2.5.8 - #removing environments....
Now using system ruby.
[root@k8s-m1 ~]# ruby --version
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
[root@k8s-m1 ~]# 

再次安装ruby-redis的相关依赖

[root@k8s-m1 ~]# gem install redisFetching redis-5.1.0.gem
Fetching connection_pool-2.4.1.gem
Fetching redis-client-0.21.1.gem
Successfully installed connection_pool-2.4.1
Successfully installed redis-client-0.21.1
Successfully installed redis-5.1.0
Parsing documentation for connection_pool-2.4.1
Installing ri documentation for connection_pool-2.4.1
Parsing documentation for redis-client-0.21.1
Installing ri documentation for redis-client-0.21.1
Parsing documentation for redis-5.1.0
Installing ri documentation for redis-5.1.0
Done installing documentation for connection_pool, redis-client, redis after 1 seconds
3 gems installed

以上就是指定版本的ruby安装,建议一般情况下,可以直接安装支持的最高版本。

http://www.yayakq.cn/news/931431/

相关文章:

  • 徐老师在那个网站做发视频佛山顺德专业做网站
  • 上海网站建设机构138企业邮箱登录
  • 南京 网站开发什么待遇啊与网站建立的链接不安全怎么办
  • 网站建设网站营销淮阳 网站建设
  • 网站建设有哪些类型宁波seo教学
  • 旅游网站开发项目介绍广告创意制作
  • 高端广告公司网站建设价格网站怎么注册
  • 树莓派可以做网站的服务器吗公司网站域名在哪里备案
  • 河北网站备案注册一家有限公司需要多少钱
  • 哪有宝安网站推广百度极速版app下载
  • 太原论坛2021杭州seo优化
  • 品牌建设完整版优化大师是什么软件
  • 同程网 网站模板免费企业网站建设条件
  • 网站关于页面网页设计平面设计培训机构
  • 成都制作网站价格福州百度关键词排名
  • 营销型网站建设实训报告个人总结绍兴seo包年排行榜
  • 网站建设管理典型经验网站建设与规划的书
  • 龙井茶网站建设目的餐饮店设计哪家好
  • 网站建设需要岗位深圳英文网站推广
  • 宁波广告公司网站建设深圳网站制作首选灵点网络
  • 深圳系统开发高端网站建设注册公司是在哪个网站
  • 北京网站设计公司招聘信息一个人怎样做网站
  • 网站建设方为客户提供使用说明书定西谁做网站
  • 企业手机端网站源码下载保定做网站
  • 武夷山住房和城乡建设部网站营销型网站建立
  • 柳州企业网站建设徐州建设工程交易网中标公示
  • 沈阳定制网站黑龙江省公共资源交易中心
  • 门户网站盈利盐城做网站优化
  • 一个网站可以同时几个主域名吗图片制作的软件有哪些
  • 云南省城乡和住房建设厅网站银川森淼生态园