1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

knife-zeroで"Unable to activate knife-zero-1.13.1"とエラーが出た時の対処法(訂正あり)

Last updated at Posted at 2016-02-01

chefを使い始めて、roleの設定などは基本的にはjsonを書き換えて行っていたのですが、knifeコマンドでいろいろnodeなりcookbookの登録なりを設定しようとしたところ、エラーにはまってしまいました、、

error msg

knife cookbook create setup_mysql -o cookbooks/
/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2112:in `raise_if_conflicts': Unable to activate knife-zero-1.13.1, because chef-12.5.1 conflicts with chef (~> 12.6) (Gem::ConflictError)
	from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1280:in `activate'
	from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems.rb:198:in `rescue in try_activate'
	from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems.rb:195:in `try_activate'
	from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
	from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require'
	from /Users/yassy/.chefdk/gem/ruby/2.1.0/gems/knife-zero-1.13.1/lib/chef/knife/zero_apply.rb:2:in `<top (required)>'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife/core/subcommand_loader.rb:94:in `load'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife/core/subcommand_loader.rb:94:in `block in load_commands'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife/core/subcommand_loader.rb:94:in `each'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife/core/subcommand_loader.rb:94:in `load_commands'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife/core/subcommand_loader.rb:104:in `load_command'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife/core/subcommand_loader.rb:118:in `command_class_from'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:137:in `subcommand_class_from'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:198:in `run'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/knife.rb:142:in `run'
	from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/bin/knife:25:in `<top (required)>'
	from /usr/local/bin/knife:54:in `load'
	from /usr/local/bin/knife:54:in `<main>'

原因

単にchef-client のversion がknife-zero で使いたかったものと異なっていてコンフリクトしてしまっていたよう。

対応

2/2追記:
コメントいただいた下記の対応が正解のようでしたmm

参考:http://stackoverflow.com/questions/20205889/how-to-update-the-chef-client-version

上記のstock-overflowどおりにchef-clientのversionをあげて一旦エラーは出なくなりました

いまいちchefについてわかっておらず、四苦八苦しましたが、何かの参考まで、、

1
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?