【问题标题】:Berks: Unable to satisfy constraints on package , which does not exist,Berks:无法满足对 package 的约束,它不存在,
【发布时间】:2018-07-20 20:13:53
【问题描述】:

我有一个非常小的例子。 1 本食谱,含 1 个食谱和 1 个 ohai 插件文件,但在运行 berks/berks 安装或运行厨房时出现错误

我确实安装了 ohai gem:

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 目录中

建议?

谢谢,

安德鲁

【问题讨论】:

    标签: chef-infra ohai-gem berksfile


    【解决方案1】:

    应该是depends "ohai",它必须是一个字符串。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-28
      • 2016-02-09
      • 1970-01-01
      • 2014-10-27
      • 2014-06-19
      • 1970-01-01
      相关资源
      最近更新 更多