厨师长没有加载nginx

厨师长没有加载nginx,nginx,chef-infra,vagrant,Nginx,Chef Infra,Vagrant,我用的是流浪汉和厨师。我有一个配方,应该加载和配置nginx 在我的档案中,我有: chef.cookbooks_path = [ 'chef/cookbooks', 'chef/cookbooks-sources' ] include_recipe 'nginx' 在我的支票上: cookbook 'nginx', git: 'https://github.com/opscode-cookbooks/nginx.git' 在食谱中的my recipe metadata.rb中

我用的是流浪汉和厨师。我有一个配方,应该加载和配置nginx

在我的档案中,我有:

  chef.cookbooks_path = [ 'chef/cookbooks', 'chef/cookbooks-sources' ]
 include_recipe 'nginx' 
在我的支票上:

cookbook 'nginx',
  git: 'https://github.com/opscode-cookbooks/nginx.git'
在食谱中的my recipe metadata.rb中,来源:

depends "nginx"
在我的食谱中,我有:

  chef.cookbooks_path = [ 'chef/cookbooks', 'chef/cookbooks-sources' ]
 include_recipe 'nginx' 
Cheffile.lock看起来像:

DEPENDENCIES
  apt (>= 0)
  cassandra (>= 0)
  curl (>= 0)
  elasticsearch (>= 0)
  java (>= 0)
  java_extras (>= 0)
  phantomjs (>= 0)
  postgresql (>= 0)
  python (>= 0)
  redis (>= 0)
  rvm (>= 0)
  sbt-extras (>= 0)
  windows (= 1.8.6)
当我遇到流浪汉或食物时,我得到以下信息:

[2013-07-02T20:21:40+00:00] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook nginx not found. If you're loading nginx from another cookbook, make sure you configure the dependency in your metadata

我如何修正我的错误

您使用的是像Berkself这样的食谱管理器吗?如果没有,你应该调查一下,它可以帮助你解决这个问题。我对chefFile不熟悉,也许这是一个食谱经理

解决这一问题的一个不太理想的选择是手动克隆nginx cookbook repo并将其放入chef/cookbooks或chef/cookbooks源中,这将解决您的问题。

您的Cheffile.lock不列出nginx依赖项,但列出了许多其他依赖项,因此此处缺少一些内容

添加nginx cookbook后是否运行了Library chef安装或更新?您应该有chef/cookbooks/nginx/目录


Library Chef也默认安装为./cookbooks/,因此在您的安装中,您需要在第一时间为它指定-path=Chef/cookbooks,前提是Cheffile与Vagrantfile位于同一目录中。

Cheffile由Library Chef使用,berkshelf的一个替代工具。+1还有一个用于vagrant的有用的图书管理员插件,它将自动运行安装/更新。