厨师Gem::ConflictError当运行刀bootstrapwindows

Chef Gem::ConflictError when running knife bootstrap windows

我在我的 Windows 8.1 桌面上安装了 Chef,我正在尝试 bootstrap 托管 Chef 服务器中的一个节点。这是我第一次尝试。

当我 运行 knife bootstrap windows winrm NODE_IP --winrm-user NODE_USER --winrm-password 'NODE_PASSWORD' 命令时,我得到以下 Ruby 错误...

C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2104:in `raise_if_conflicts': Unable to activate winrm-s-0.3.1, because winrm-1.2.0 conflicts with winrm (~> 1.3.0) (Gem::ConflictError)
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1282:in `activate'
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1316:in `block in activate_dependencies'
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1302:in `each'
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1302:in `activate_dependencies'
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1284:in `activate'
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems.rb:198:in `rescue in try_activate'
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems.rb:195:in `try_activate'
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
    from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require'
    from C:/Users/adamgilmore/.chefdk/gem/ruby/2.1.0/gems/knife-windows-0.8.6/lib/chef/knife/bootstrap_windows_base.rb:22:in `<top (required)>'
    from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife/core/subcommand_loader.rb:44:in `load'
    from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife/core/subcommand_loader.rb:44:in `block in load_commands'
    from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife/core/subcommand_loader.rb:44:in `each'
    from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife/core/subcommand_loader.rb:44:in `load_commands'
    from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:127:in `load_commands'
    from C:/opscode/chefdk/embedded/apps/chef/lib/chef/knife.rb:208:in `run'
    from C:/opscode/chefdk/embedded/apps/chef/lib/chef/application/knife.rb:142:in `run'
    from C:/opscode/chefdk/embedded/apps/chef/bin/knife:25:in `<top (required)>'
    from C:/opscode/chefdk/bin/knife:63:in `load'
    from C:/opscode/chefdk/bin/knife:63:in `<main>'

安装的 Chef 版本...

Chef Development Kit Version: 0.6.2 
chef-client version: 12.3.0 
berks version: 3.2.4 
kitchen version: 1.4.0

已安装宝石

activesupport (4.2.1)
addressable (2.3.8)
akami (1.3.1)
app_conf (0.4.2) 
appbundler (0.4.0)
archive (0.0.6)
aruba (0.6.2)
ast (2.0.0)
astrolabe (1.3.0)
aws-sdk-v1 (1.64.0)
axiom-types (0.1.1)
berkshelf (3.2.4)
berkshelf-api-client (1.2.1)
bigdecimal (1.2.4)
buff-config (1.0.1)
buff-extensions (1.0.0)
buff-ignore (1.1.1)
buff-ruby_engine (0.1.0)
buff-shell_out (0.2.0)
builder (3.2.2)
bundler (1.7.12)
cane (2.6.2)
celluloid (0.16.0)
celluloid-io (0.16.2)
CFPropertyList (2.3.1)
chef (12.3.0 x86-mingw32)
chef-dk (0.6.2)
chef-provisioning (1.1.1)
chef-provisioning-aws (1.1.1)
chef-provisioning-azure (0.3.2)
chef-provisioning-fog (0.13.2)
chef-provisioning-vagrant (0.8.3)
chef-vault (2.4.0)
chef-zero (4.2.2, 1.5.6)
cheffish (1.2)
chefspec (4.2.0)
childprocess (0.5.6)
cleanroom (1.0.0)
codeclimate-test-reporter (0.4.7)
coderay (1.1.0)
coercible (1.0.0)
cookbook-omnifetch (0.2.1)
countloc (0.4.0)
crack (0.4.2)
cucumber (2.0.0, 1.3.19)
cucumber-core (1.1.3)
dep-selector-libgecode (1.0.2)
dep_selector (1.0.3)
descendants_tracker (0.0.4)
diff-lcs (1.2.5)
diffy (3.0.7)
docile (1.1.5)
domain_name (0.5.24)
em-winrm (0.7.0, 0.6.0)
equalizer (0.0.11)
erubis (2.7.0)
eventmachine (1.0.7)
excon (0.45.3)
fakefs (0.6.7)
faraday (0.9.1)
fauxhai (2.3.0, 2.2.0)
ffi (1.9.8 x86-mingw32, 1.3.1 x86-mingw32)
ffi-yajl (2.2.0)
finstyle (1.4.0)
fission (0.5.0)
fog (1.31.0)
fog-atmos (0.1.0)
fog-aws (0.4.0)
fog-brightbox (0.7.1)
fog-core (1.30.0)
fog-ecloud (0.1.3)
fog-google (0.0.5)
fog-json (1.0.2)
fog-local (0.2.1) 
fog-powerdns (0.1.1)
fog-profitbricks (0.0.3)
fog-radosgw (0.0.4)
fog-riakcs (0.1.0)
fog-sakuracloud (1.0.1)
fog-serverlove (0.1.2) 
fog-softlayer (0.4.6)
fog-storm_on_demand (0.1.1)
fog-terremark (0.1.0)
fog-vmfusion (0.1.0)
fog-voxel (0.1.0)
fog-xml (0.1.2)
foodcritic (4.0.0)
formatador (0.2.5)
fuubar (1.3.3)
gherkin (2.12.2 x86-mingw32)
git (1.2.9.1)
grape (0.11.0)
grape-msgpack (0.1.2)
gssapi (1.2.0, 1.0.3)
guard (2.12.6)
guard-compat (1.2.1)
guard-rspec (4.5.2)
gyoku (1.3.1)
hashie (2.1.2)
highline (1.7.2)
hitimes (1.2.2 x86-mingw32)
http (0.8.12)
http-cookie (1.0.2)
http-form_data (1.0.1)
http_parser.rb (0.6.0)
httpclient (2.6.0.1)
httpi (0.9.7)
i18n (0.7.0)
ice_nine (0.11.1)
inflecto (0.0.2)
inifile (2.0.2)
io-console (0.4.2)
ipaddress (0.8.0)
json (1.8.3, 1.8.1)
kitchen-vagrant (0.18.0)
knife-spork (1.5.0)
knife-windows (0.8.6, 0.8.5)
libyajl2 (1.2.0)
listen (2.10.0)
little-plugger (1.1.3)
logging (1.8.2)
lumberjack (1.0.9)
macaddr (1.7.1)
maruku (0.7.2)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (2.6.1)
mini_portile (0.6.2, 0.6.0)
minitar (0.5.4)
minitest (5.7.0, 4.7.5)
mixlib-authentication (1.3.0)
mixlib-cli (1.5.0)
mixlib-config (2.2.1)
mixlib-log (1.6.0)
mixlib-shellout (2.1.0 universal-mingw32)
mocha (1.1.0)
moneta (0.6.0)
msgpack (0.5.12 x86-mingw32)
multi_json (1.11.1)
multi_test (0.1.2)
multi_xml (0.5.5)
multipart-post (2.0.0)
nenv (0.2.0)
net-http-persistent (2.9.4)
net-scp (1.2.1)
net-ssh (2.9.2)
net-ssh-gateway (1.2.0)
net-ssh-multi (1.2.1)
nio4r (1.1.0)
nokogiri (1.6.6.2 x86-mingw32, 1.6.3.1 x86-mingw32)
nori (2.6.0, 1.1.5)
notiffany (0.0.6)
octokit (3.8.0)
ohai (8.4.0)
paint (1.0.0)
parallel (1.6.0)
parser (2.3.0.pre.1)
plist (3.1.0)
polyglot (0.3.5)
powerpack (0.0.9)
pry (0.10.1 i386-mingw32)
psych (2.0.5)
puma (1.6.3)
rack (1.6.1, 1.5.3)
rack-accept (0.4.5)
rack-mount (0.8.3)
rainbow (2.0.0)
rake (10.4.2, 10.1.1, 10.1.0, 0.9.6)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
rdoc (4.1.0)
reel (0.5.0)
retryable (2.0.1)
ridley (4.2.0)
rspec (3.3.0, 3.0.0)
rspec-core (3.3.0, 3.0.4)
rspec-expectations (3.3.0, 3.0.4) 
rspec-its (1.2.0)
rspec-mocks (3.3.0, 3.0.4)
rspec-support (3.3.0, 3.0.4)
rspec_junit_formatter (0.2.3)
rubocop (0.28.0)
ruby-progressbar (1.7.5)
ruby_gntp (0.3.4)
rubygems-update (2.4.4)
rubyntlm (0.4.0, 0.1.1)
rubyzip (1.1.7)
rufus-lru (1.0.5)
safe_yaml (1.0.4)
savon (0.9.5)
sawyer (0.6.0)
semverse (1.2.1)
serverspec (2.18.0)
shellany (0.0.1)
simplecov (0.10.0)
simplecov-html (0.10.0)
slop (3.6.0)
solve (1.2.1)
specinfra (2.35.1)
spork (0.9.2)
stuartpreston-azure-sdk-for-ruby (0.7.1)
systemu (2.6.5)
test-kitchen (1.4.0)
test-unit (2.1.5.0)
thor (0.19.1) 
thread_safe (0.3.5)
timers (4.0.1)
treetop (1.4.15)
tzinfo (1.2.2)
unf (0.1.4)
unf_ext (0.0.7.1 x86-mingw32)
uuid (2.3.8)
uuidtools (2.1.5)
varia_model (0.4.0)
virtus (1.0.5)
wasabi (1.0.0)
webmock (1.21.0)
websocket_parser (1.0.0)
win32-api (1.5.3 universal-mingw32)
win32-dir (0.4.5)
win32-event (0.6.1)
win32-eventlog (0.6.1)
win32-ipc (0.6.3)
win32-mmap (0.4.0)
win32-mutex (0.4.1)
win32-process (0.7.5)
win32-service (0.8.2)
win32console (1.3.2 x86-mingw32)
windows-api (0.4.4)
windows-pr (1.2.4)
winrm (1.3.3, 1.2.0)
winrm-s (0.3.1, 0.2.4)
winrm-transport (1.0.1, 1.0.0)
wmi-lite (1.0.0)
yajl-ruby (1.2.1)
yard (0.8.7.6)

我不是 Ruby 开发人员,因此很难调试 - 非常感谢任何帮助。

这里遇到了同样的问题。这个网站也许对你有帮助https://github.com/chef/knife-windows/issues/236

至于我,我将 .~/.chefdk 重命名为 ~/.chefdk_old。

我刚遇到同样的问题。问题是您同时安装了 knife-windows 0.8.5 和 0.8.6。设置工作站的入门文档说您需要安装 knife-windows,但它已经安装了。当您安装它时,它会安装 0.8.6。那个版本好像有问题。 bootstrap 脚本没有专门使用 0.8.5,所以它只使用可用的最新版本。您可以尝试修改脚本,但我所做的只是卸载 knife-windows 0.8.6 (chef gem uninstall knife-windows --version 0.8.6)。之后我能够 bootstrap 机器。

我在设置新的 linux 机器时遇到了同样的问题,我需要从该机器获得 bootstrap windows 个节点。在我安装 0.8.6 之前,该系统上没有以前存在的 knife-windows 版本。卸载 0.8.6 并专门安装 0.8.5 解决了现在的问题,这是一个糟糕的长期解决方案。

我有同样的问题。 原因是安装了多个 winrm 版本。 所以我卸载了作为 chef dev kit 安装的一部分安装的较低版本的 winrm。

root@ip-XXX-XX-XX-XXX:/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems# gem uninstall -i /opt/chefdk/embedded/lib/ruby/gems/2.1.0 winrm

You have requested to uninstall the gem:
        winrm-1.2.0

chef-provisioning-0.18 depends on winrm (~> 1.2.0)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y
Successfully uninstalled winrm-1.2.0

root@ip-XXX-XX-XX-XXX:/opt/chefdk/embedded/bin# knife ec2 server list
WARNING: No knife configuration file found
ERROR: You did not provide a valid 'AWS Access Key Id' value.
ERROR: You did not provide a valid 'AWS Secret Access Key' value.