bmstudy
bmstudy

Reputation: 39

Chef Cookbook dependency in Windows in offline

I am running chef on local mode in windows (offline).There is a dependency with the cookbook 'windows' so ,metadata.rb file has the line

- depends "windows".

So I downloaded the cookbook and kept it locally on the server in D drive and added the following line in Berkfile

 source "file:///D:/chef/"
 "cookbook 'windows',path:'D:\chef\windows'

After this , when "berks install" is executed, it does the following

Fetching 'ckbk' from source at .
Fetching 'windows' from source at ../windows
Fetching cookbook index from file:///D:/chef/...
berks : C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/http/http_request.rb:147:in `build_headers': undefined method 
`<<' for nil:NilClass (NoMethodError)

How to resolve dependencies offline in Windows?

Chef Development Kit Version: 2.1.11

chef-client version: 13.2.20

Upvotes: 0

Views: 198

Answers (1)

coderanger
coderanger

Reputation: 54249

I only barely make heads or tails of your question, but your source line is wrong. That has to point at one of the kinds of things Berkshelf supports, not a file URI. What you want is this:

source chef_repo: 'D:/chef'

That will look for cookbooks in subfolders of that. And with that, you don't need the cookbook line at all, it will find the cookbook as needed.

Upvotes: 1

Related Questions