Chef infra Berks:无法满足对不存在的包的约束,

Chef infra Berks:无法满足对不存在的包的约束,,chef-infra,ohai-gem,berksfile,Chef Infra,Ohai Gem,Berksfile,我有一个很小的例子。1本食谱,包含1个菜谱和1个ohai插件文件,但运行berks/berks安装时出错,或运行kitchen时出错 我确实安装了ohai gems: chefspec-ohai (0.2.0) ohai (14.2.0) 插件位于./files/default/apache_modules.rb中: Ohai.plugin :Apache do provides 'apache/modules' collect_data :default do apache

我有一个很小的例子。1本食谱,包含1个菜谱和1个ohai插件文件,但运行berks/berks安装时出错,或运行kitchen时出错

我确实安装了ohai gems:

chefspec-ohai (0.2.0)
ohai (14.2.0)
插件位于./files/default/apache_modules.rb中:

Ohai.plugin :Apache do
  provides 'apache/modules'

  collect_data :default do
    apache(Mash.new)
    modules_cmd = shell_out('apachectl -t -D DUMP_MODULES')
    apache[:modules] = modules_cmd.stdout
  end
end
错误是:

Unable to satisfy constraints on package , which does not exist, due to solution constraint (apache = 0.1.0). Solution constraints that may result in a constraint on : [(apache = 0.1.0) -> ( >= 0.0.0)]
Missing artifacts:
Demand that cannot be met: (apache = 0.1.0)
请注意,在第一行中,package和逗号之间有一个空格。所以我不知道它在抱怨什么包裹

我的食谱名为apache,有1个菜谱default.rb:

package 'httpd'

service 'httpd' do
  action [:start, :enable]
end
元数据.rb:

name 'apache'
maintainer 'The Authors'
maintainer_email 'you@example.com'
license 'All Rights Reserved'
description 'Installs/Configures apache'
long_description 'Installs/Configures apache'
version '0.1.0'
depends ohai
伯克斯菲尔:

source 'https://supermarket.chef.io'
metadata
my Berksfile和metadata.rb都在cookbooks/apache目录中

建议

谢谢


Andrew

应该是
取决于“ohai”
,它必须是一个字符串