0

我正在尝试使用librarian-puppet来管理 puppet 模块,但是当我运行安装时,会发生以下情况:

当我运行尝试安装模块时Puppetfile,我收到此错误:

PS C:\wamp64\www\spider\bio\puppet> librarian-puppet install --no-use-v1-api
C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (Faraday::SSLError)

这是完整的堆栈跟踪:

C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (Faraday::SSLError)
        from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:933:in `connect'
        from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
        from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:852:in `start'
        from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:1398:in `request'
        from C:/Ruby23-x64/lib/ruby/2.3.0/net/http.rb:1156:in `get'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:80:in `perform_request'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:40:in `block in call'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http.rb:32:in `call'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/puppet_forge-2.2.2/lib/puppet_forge/connection/connection_failure.rb:9:in `call'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/response.rb:8:in `call'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday_middleware-0.10.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/puppet_forge-2.2.2/lib/puppet_forge/middleware/symbolify_json.rb:64:in `call'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:139:in `build_response'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:377:in `run_request'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:140:in `get'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/puppet_forge-2.2.2/lib/puppet_forge/v3/base.rb:69:in `request'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/puppet_forge-2.2.2/lib/puppet_forge/v3/base.rb:76:in `find_request'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/puppet_forge-2.2.2/lib/puppet_forge/v3/base.rb:82:in `find'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/lib/librarian/puppet/source/forge/repo_v3.rb:42:in `get_module'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/lib/librarian/puppet/source/forge/repo_v3.rb:19:in `get_versions'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/lib/librarian/puppet/source/forge/repo.rb:15:in `versions'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/lib/librarian/puppet/source/forge/repo.rb:42:in `manifests'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/lib/librarian/puppet/source/forge.rb:152:in `manifests'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/dependency.rb:155:in `cache_manifests!'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/dependency.rb:151:in `manifests'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:159:in `block in resolving_dependency_map_find_manifests'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:172:in `block (2 levels) in scope_resolving_dependency'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:186:in `block in scope_checking_manifests'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:230:in `scope'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:185:in `scope_checking_manifests'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:171:in `block in scope_resolving_dependency'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:230:in `scope'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:170:in `scope_resolving_dependency'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:158:in `resolving_dependency_map_find_manifests'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:65:in `do_resolve'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:50:in `resolve'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/resolver.rb:23:in `resolve'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/action/resolve.rb:31:in `run'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/lib/librarian/puppet/action/resolve.rb:10:in `run'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/lib/librarian/puppet/cli.rb:104:in `resolve!'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/lib/librarian/puppet/cli.rb:68:in `install'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/cli.rb:31:in `returning_status'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/cli.rb:26:in `block in bin!'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/cli.rb:47:in `with_environment'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarianp-0.6.3/lib/librarian/cli.rb:26:in `bin!'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/librarian-puppet-2.2.3/bin/librarian-puppet:7:in `<top (required)>'
        from C:/Ruby23-x64/bin/librarian-puppet:22:in `load'
        from C:/Ruby23-x64/bin/librarian-puppet:22:in `<main>'

我尝试将 Ruby 降级到 2.1。这一次,我什至无法安装图书馆员木偶,这是错误:

PS C:\wamp64\www\spider\bio> gem install librarian-puppet
ERROR:  Could not find a valid gem 'librarian-puppet' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/latest_specs.4.8.gz)

我可以librarian-puppet安装Ruby 2.3. 我可以使用puppet install repo-module. 它只是那libarian-puppet不起作用。我需要配置什么才能使其正常工作吗?

4

2 回答 2

1

这似乎是一个已知的RubyGems 问题

显然您需要下载最新版本的 RubyGems 并手动安装:

gem install --local C:\rubygems-update-2.6.7.gem
update_rubygems --no-ri --no-rdoc

然后应该可以切换回自动安装:

gem uninstall rubygems-update -x

如果上述方法不适合您,链接的 RubyGems 页面还链接到手动添加受信任证书的方法。

于 2016-12-23T13:53:25.793 回答
0

我有同样的问题,所以我按照说明进行安装update-rubygems,当我运行它时,我收到了这个错误:

PS C:\wamp64\www\spider\vagrant> update_rubygems --no-ri --no-rdoc
Error: Cannot find RubyGems Update Path!

我读过它,这发生在 Windows Ruby 安装中。下面是如何修复它,您需要将此行添加到update_rubygemsruby​​ bin 文件夹中的文件中:

gem 'rubygems-update', version

这是你添加它的地方:

#!C:/Ruby23-x64/bin/ruby.exe
#
# This file was generated by RubyGems.
#
# The application 'rubygems-update' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"
gem 'rubygems-update', version

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

load Gem.bin_path('rubygems-update', 'update_rubygems', version)

现在它起作用了:

PS C:\wamp64\www\spider\vagrant> update_rubygems --no-ri --no-rdoc
RubyGems 2.6.8 installed

=== 2.6.8 / 2016-10-29

Bug fixes:

* Improve SSL verification failure message. Pull request #1751
  by Eric Hodel.
* Ensure `to_spec` falls back on prerelease specs. Pull request
  #1755 by André Arko.
* Update vendored Molinillo to 0.5.3. Pull request #1763 by
  Samuel Giddins.


------------------------------------------------------------------------------

RubyGems installed the following executables:
        C:/Ruby23-x64/bin/gem

不幸的是,它没有解决librarian-puppet install问题。

于 2016-12-23T16:41:15.580 回答