Gabriele B
Gabriele B

Reputation: 2685

Berkself won't resolve a cookbook on github

I've built a coookbook which in turns depends on a github-hosted one.

This is the beginning of my berksfile

source "https://api.berkshelf.com"

cookbook 'r', github: 'stevendanna/cookbook-r'
cookbook 'apt'

[...]

but doing a vagrant up command I ended up with this:

The stdout and stderr are shown below:

    stdout: Resolving cookbook dependencies...
Fetching 'analytics' from source at cookbooks/analytics
Fetching cookbook index from https://api.berkshelf.com...

    stderr: Ignoring wdm-0.1.1 because its extensions are not built.  Try: gem pristine wdm --version 0.1.1
Unable to satisfy the following requirements:

- `r (>= 0.0.0)` required by `analytics-0.2.0`

it looks like the 'r' cookbook is not correctly resolved by berkshelf to be pulled out from github, although it definitively should as I set the repo on the berksfile as above.

Shall I have to set an explicit path or URL or another bit somewhere else?

This is the provision script which include the cookbook: analytics-vagrant

(Vagrant 1.8.7 used)

Upvotes: 0

Views: 308

Answers (1)

lamont
lamont

Reputation: 3974

Berkshelf files are not transitive. The only Berksfile being evaluated is your top-level cookbook, the Berksfile in the dependent cookbook which has the github override is never evaluated. You need to replicate the git override in the top-level cookbook as well.

This is the same way that bundler/Gemfile/Gemfile.lock works as well, transitive bundles are not evaluated.

Upvotes: 2

Related Questions