gem install bundler SSL证书错误 解决办法

最近在windows10电脑上装上PentestBox后,直接用“msfconsole”命令启动metasploit时,却发现需要先让我执行ruby中的“gem install bundler”命令,意思是先让我安装一个bundler,结果却报了如下错误:

ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted store
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted store
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted store
ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
          Unable to download data from https://gems.ruby-china.com/ - SSL_connect retu ned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certi icate) (https://gems.ruby-china.com/specs.4.8.gz)
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted store
ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local tr sted store

gem install bundler SSL verification error

 

解决办法

正常情况下,你是不会遇到 SSL 证书错误的,除非你的 Ruby 安装方式不正确。

如果遇到 SSL 证书问题,你又无法解决。

Linux上,请修改 ~/.gemrc 文件,增加 ssl_verify_mode: 0 配置,以便于 RubyGems 可以忽略 SSL 证书错误。

windows上, .gemrc 存放在: c:\用户\你的账户 下面,也就是类似于:C:\Users\fujie下面。

 

以下是我修改成功后再去执行“gem install bundler”命令的结果,以下结果,说明安装成功了,已经解决了这个SSL证书ERROR的问题。

ERROR:  SSL verification error at depth 1: unable to get local issuer certificate (20) ERROR:  You must add /O=Digital Signature Trust Co./CN=DST Root CA X3 to your local trusted store
Fetching: bundler-2.0.1.gem (100%)
Successfully installed bundler-2.0.1(已成功安装bundler-2.0.1)
Parsing documentation for bundler-2.0.1(解析bundler-2.0.1的文档)
Installing ri documentation for bundler-2.0.1(安装bundler-2.0.1的ri文档)
Done installing documentation for bundler after 5 seconds(5秒后完成为bundler安装文档)
1 gem installed

gem install bundler 成功

 

注意:

如果你操作此步骤后已经成功后,再去执行“msfconsole“,你会发现照样启动不了。还是提示需要你安装bundler(gem install bundler),还出现这个问题多半的原因是因为你的电脑上还装有其它版本的ruby,你可以看一下你的ruby版本是否是用的PentestBox里面的ruby?(cmd窗口执行:ruby -v );如果不是,请自我修改。

 

修改原理请查看:Windows下解决Python双版本问题 更改Python默认版本方法

    A+
发布日期:2019年03月13日 19:35:10  所属分类:PentestBox  Ruby
最后更新时间:2019-03-13 19:40:08
付杰
  • ¥ 69.0元
  • 市场价:69.0元
  • ¥ 798.0元
  • 市场价:1298.0元
  • ¥ 45.0元
  • 市场价:45.0元
  • ¥ 149.0元
  • 市场价:299.0元

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: