厨师:不能在 metadata.rb 中使用 depends 'httpd'

chef: cant use depends 'httpd' in metadata.rb

我无法使用我的厨师食谱 depends 'httpd',这是我的 metadata.rb:

name 'awesome_customers_rhel'
maintainer 'The Authors'
maintainer_email 'you@example.com'
license 'all_rights'
description 'Installs/Configures awesome_customers_rhel'
long_description 'Installs/Configures awesome_customers_rhel'
version '0.1.0'

depends 'selinux', '~> 0.9.0'
depends 'firewall', '~> 2.4.0'
depends 'httpd'

我使用 depends 'httpd' 的任何尝试都会导致此错误。

我正在处理 tutorial on using the chef httpd cookbook from Chef Supermarket to configure a kitchen test instance. However I'm stuck at step 6。由于 compat_resource 的一些问题,Kitchen 不会收敛,指南和我的食谱之间的唯一区别是我使用的是 httpd verion 0.4.0

-----> Starting Kitchen (v1.11.1)
-----> Converging <default-centos-72>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 4.3.5...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
       Transferring files to <default-centos-72>
       Starting Chef Client, version 12.14.60
       resolving cookbooks for run list: ["awesome_customers_rhel::default"]
       Synchronizing Cookbooks:
         - awesome_customers_rhel (0.1.0)
         - selinux (0.9.0)
         - firewall (2.4.0)
         - httpd (0.4.0)
         - chef-sugar (3.4.0)
         - compat_resource (12.14.3)
       Installing Cookbook Gems:
       Compiling Cookbooks...

       ================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/httpd/libraries/helpers.rb
       ================================================================================

       LoadError
       ---------
       cannot load such file -- chef_compat/resource

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/httpd/libraries/helpers.rb:1:in `<top (required)>'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/httpd/libraries/helpers.rb:

         1>> require 'chef_compat/resource'
         2:  
         3:  module HttpdCookbook
         4:    module Helpers
         5:      def default_apache_version
         6:        return '2.2' if node['platform_family'] == 'debian' && node['platform_version'].to_i == 7
         7:        return '2.2' if node['platform_family'] == 'debian' && node['platform_version'] == '12.04'
         8:        return '2.2' if node['platform_family'] == 'debian' && node['platform_version'].to_i == 6
         9:        return '2.2' if node['platform_family'] == 'debian' && node['platform_version'].to_i == 7
        10:        return '2.2' if node['platform_family'] == 'omnios'

       Platform:
       ---------
       x86_64-linux


       Running handlers:
       [2016-09-18T19:03:29+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2016-09-18T19:03:29+00:00] ERROR: Exception handlers complete
       Chef Client failed. 0 resources updated in 01 seconds
       [2016-09-18T19:03:29+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2016-09-18T19:03:29+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2016-09-18T19:03:29+00:00] ERROR: cannot load such file -- chef_compat/resource
       [2016-09-18T19:03:29+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-centos-72>.  Please see .kitchen/logs/default-centos-72.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

这是我的 .kitchen.yml

---
driver:
  name: vagrant
  network:
    - ["private_network", {ip: "192.168.33.33"}]

provisioner:
  name: chef_zero

platforms:
  - name: centos-7.2

suites:
  - name: default
    run_list:
      - recipe[awesome_customers_rhel::default]
    attributes:

已在此处作为问题提交 https://github.com/chef-cookbooks/httpd/issues/95