ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

部署ruby环境遇到的坑

2019-12-21 18:55:36  阅读:450  来源: 互联网

标签:遇到 部署 ruby gpg rvm https root localhost


前言:

一年多前业务使用到redis-cluster集群,然而当时部署时,redis-cluster集群采用的是ruby 语言开发的脚本redis-trib.rb 来进行管理集群的。所以当时给服务器安装了ruby环境。最近项目再一次使用到了redis-cluster集群,所以没多想,直接照着当时的文档记录直接开干,居然行不通了,遇到了各种报错,此次记录在此方便后续使用查看.

服务器环境:centos7.6x84_64位,最小化安装
直接部署ruby环境:

yum -y install ruby ruby-devel
yum -y install rubygems
[root@localhost ~]# which gem
/usr/bin/gem
[root@localhost ~]# gem sources --remove http://rubygems.org/   http://rubygems.org/ removed from sources
source http://rubygems.org/ not present in cache
[root@localhost ~]# gem sources -l
***CURRENT SOURCES ***
https://rubygems.org/
[root@localhost ~]# 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    379      0 --:--:-- --:--:-- --:--:--   379
curl: (7) Failed connect to raw.githubusercontent.com:443; 拒绝连接

于是添加淘宝ruby源:

 [root@localhost ~]# gem sources --add https://ruby.taobao.org/   https://ruby.taobao.org/ added to sources
Error fetching https://ruby.taobao.org/:
    hostname "ruby.taobao.org" does not match the server certificate (https://ruby.taobao.org/specs.4.8.gz)

原来是taobao Gems 源已停止维护,现由 ruby-china 提供镜像服务,即我们要换源
参考地址:https://blog.csdn.net/chris_ime/article/details/52013349

gem sources -a   https://gems.ruby-china.com/
[root@localhost ~]# gem sources -a   https://gems.ruby-china.com/
https://gems.ruby-china.com/ added to sources
[root@localhost ~]# gem sources -l
*** CURRENT SOURCES ***
https://rubygems.org/
https://gems.ruby-china.com/

安装RVM:

[root@localhost soft]# 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     99      0  0:00:01  0:00:01 --:--:--    99
100 24535  100 24535    0     0   5477      0  0:00:04  0:00:04 --:--:-- 20299
Downloading https://github.com/rvm/rvm/archive/1.29.9.tar.gz

Downloading https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.asc
gpg: 已创建目录‘/root/.gnupg’
gpg: 新的配置文件‘/root/.gnupg/gpg.conf’已建立
gpg: 警告:在‘/root/.gnupg/gpg.conf’里的选项于此次运行期间未被使用
gpg: 钥匙环‘/root/.gnupg/pubring.gpg’已建立
gpg: 于 2019年07月10日 星期三 16时31分02秒 CST 创建的签名,使用 RSA,钥匙号 39499BDB
gpg: 无法检查签名:没有公钥
GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.29.9.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.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
[root@localhost soft]# echo $?
2

报错了,根据提示如下操作:



[root@localhost soft]# gpg --keyserver hkp://keys.gnupg.net --recv-keys ^C
[root@localhost soft]# gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB 
gpg: 钥匙环‘/root/.gnupg/secring.gpg’已建立
gpg: 下载密钥‘D39DC0E3’,从 hkp 服务器 pool.sks-keyservers.net
gpg: 下载密钥‘39499BDB’,从 hkp 服务器 pool.sks-keyservers.net
gpg: /root/.gnupg/trustdb.gpg:建立了信任度数据库
gpg: 密钥 D39DC0E3:公钥“Michal Papis (RVM signing) <mpapis@gmail.com>”已导入
gpg: 密钥 39499BDB:公钥“Piotr Kuczynski <piotr.kuczynski@gmail.com>”已导入
gpg: 没有找到任何绝对信任的密钥
gpg: 合计被处理的数量:2
gpg:           已导入:2  (RSA: 2)
[root@localhost soft]# curl -L http://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     97      0  0:00:02  0:00:01  0:00:01    97
curl: (7) Failed connect to raw.githubusercontent.com:443; 拒绝连接
[root@localhost soft]# curl -L http://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     94      0  0:00:02  0:00:02 --:--:--    94
100 24535  100 24535    0     0   2868      0  0:00:08  0:00:08 --:--:--  5254
Downloading https://github.com/rvm/rvm/archive/1.29.9.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.9/1.29.9.tar.gz.asc
gpg: 于 2019年07月10日 星期三 16时31分02秒 CST 创建的签名,使用 RSA,钥匙号 39499BDB
gpg: 完好的签名,来自于“Piotr Kuczynski <piotr.kuczynski@gmail.com>”
gpg: 警告:这把密钥未经受信任的签名认证!
gpg:       没有证据表明这个签名属于它所声称的持有者。
主钥指纹: 7D2B AF1C F37B 13E2 069D  6956 105B D0E7 3949 9BDB
GPG verified '/usr/local/rvm/archives/rvm-1.29.9.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 

标签:遇到,部署,ruby,gpg,rvm,https,root,localhost
来源: https://blog.51cto.com/wujianwei/2460638

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有