1

非常に小さな例があります。1 つのレシピと 1 つの ohai プラグイン ファイルを含む 1 つのクックブックが、berks/berks のインストールの実行中にエラーが発生するか、キッチンの実行時に収束する

私は 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)

最初の行で、パッケージとコンマの間にスペースがあることに注意してください。そのため、どのパッケージについて不平を言っているのか途方に暮れています。

私の料理本の名前は 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

私の Berksfile と metadata.rb は両方とも cookbooks/apache ディレクトリにあります

提案?

ありがとう、

アンドリュー

4

1 に答える 1