Search code examples
chef-infraohai-gemberksfile

Berks: Unable to satisfy constraints on package , which does not exist,


I have a very small example. 1 cookbook with 1 recipe and 1 ohai plugin file but getting errors running berks/berks install or converging when running kitchen

I do have the ohai gems installed:

chefspec-ohai (0.2.0)
ohai (14.2.0)

the plugin is in ./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

the error is:

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)

Notice on the first line there is a space between package and the comma. So I'm at a loss as to what package it is complaining about.

my cookbook is named apache and has 1 recipe default.rb:

package 'httpd'

service 'httpd' do
  action [:start, :enable]
end

metadata.rb:

name 'apache'
maintainer 'The Authors'
maintainer_email '[email protected]'
license 'All Rights Reserved'
description 'Installs/Configures apache'
long_description 'Installs/Configures apache'
version '0.1.0'
depends ohai

Berksfile:

source 'https://supermarket.chef.io'
metadata

my Berksfile and metadata.rb are both in the cookbooks/apache dir

Suggestions?

Thanks,

Andrew


Solution

  • That should be depends "ohai", it has to be a string.