Trying to setup a rails app using chef but getting Missing Cookbooks error.
Steps to Reproduce
$ chef generate app chef_rails #create new app that will hold cookbooks for rails.
$ echo "cookbook 'ruby-ng'" >> cookbooks/chef_rails/Berksfile
$ cd cookbooks/chef_rails/
$ berks install
$ berks vendor
$ cd ../../
$ vim .kitchen.yml #add `recipe[ruby-ng::default]` to runlist
$ kitchen converge
Which gives the following error:
Missing Cookbooks: ------------------ No such cookbook: ruby-ng
Expanded Run List: ------------------ * chef_rails::default * ruby-ng::default
For this, I search the existing answers on stackoverflow & figured that if I move vendored cookbooks, chef is able to find them
$ mv cookbooks/chef_rails/berks-cookbooks/* cookbooks
$ ls cookbooks
apt chef_rails mingw ruby-ng windows
build-essential compat_resource ohai seven_zip
$ kitchen converge #works flawlessly
$ kitchen list
Instance Driver Provisioner Verifier Transport Last Action Last Error
default-ubuntu-1404 Vagrant ChefZero Inspec Ssh Converged <None>
Here are the versions, I am using:
$ chef --version
Chef Development Kit Version: 1.1.16
chef-client version: 12.17.44
delivery version: master (83358fb62c0f711c70ad5a81030a6cae4017f103)
berks version: 5.2.0
kitchen version: 1.14.2
Questions
- I am able to fix the error but I don't understand "why" this error occurred.I think this is related to
chef_repo_pathbut don't really understand it. so if can explain or point to relevant docs? - Should I be vendoring the cookbooks into
./cookbooksinstead of./cookbooks/chef_rails/berks-cookbooks/. if yes, then how do I makeberks vendordo that? - After development, For uploading to github. should include the vendored cookbooks in the repo as well? Planning to use these cookbooks with Chef Server to setup server for rails.