[chef] Re: Help with Chef::CookbookLoader for 0.7.16


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Help with Chef::CookbookLoader for 0.7.16
  • Date: Wed, 17 Feb 2010 08:23:59 -0800

Ohai!
Hard to say without seeing more of your code, but my first guess is
that you need to setup Chef::Config and make sure the :cookbook_path
config option is set.

If you're just doing `require 'chef'` you should get Chef::Config
loaded so you could just do Chef::Config[:cookbook_path] =
'/your/cookbook/path' before running CookbookLoader#load_cookbooks.

HTH,
Dan DeLeo

On Wed, Feb 17, 2010 at 6:29 AM,  
< >
 wrote:
> Hi!
>
> I'm trying to develop a application that uses Chef for deploying Software.
> Because of that, I need to get all available cookbooks. I found the
> CookbookLoader-class but it seems that it doesn't work.
> When I try
>
> c_list = Chef::CookbookLoader.new
>
> I can't access any cookbook. Trying to get the apache2 cookbook I get the 
> error
>
> /usr/lib/ruby/gems/1.8/gems/chef-0.7.16/lib/chef/cookbook_loader.rb:126:in
> `[]': Cannot find a cookbook named apache2; did you forget to add metadata 
> to a
> cookbook? (http://wiki.opscode.com/display/chef/Metadata) (ArgumentError)
>
> but I have no idea why it isn't working.
>
> Any suggestions?
>



Archive powered by MHonArc 2.6.16.

§