Cannot make a new cookbook


#1

I am using cygwin on my win 7 laptop to practice chef skill. But i couldn’t make a new cookbook. any help on this one?

jyu@NBW7BREYUJ1 /usr/bin
$ cd -
/cygdrive/c/chef/cookbooks

jyu@NBW7BREYUJ1 /cygdrive/c/chef/cookbooks
$ chef generate cookbook testcookbook
C:\opscode\chefdk\embedded\bin\ruby.exe: No such file or directory – /cygdrive/c/opscode/chefdk/bin/chef (LoadError)

jyu@NBW7BREYUJ1 /cygdrive/c/chef/cookbooks
$ which ruby
/usr/bin/ruby

jyu@NBW7BREYUJ1 /cygdrive/c/chef/cookbooks
$ which chef
/cygdrive/c/opscode/chefdk/bin/chef

jyu@NBW7BREYUJ1 /cygdrive/c/chef/cookbooks
$ ls -alth /usr/bin/ruby
-rwxr-xr-x 1 jyu AVERY+Group(513) 11K Mar 19 2017 /usr/bin/ruby

jyu@NBW7BREYUJ1 /cygdrive/c/chef/cookbooks
$


#2

Cygwin is not used or supported when using ChefDK, you’ll need to use a Windows Command Prompt (cmd.exe) or PowerShell to get going on Windows.

We have lots of great tutorials to follow over at https://learn.chef.io/ and I would encourage you to spend some time there to practice your Chef skill!


#3

I’ve done just this recently. Follow the notes for setting up chefdk in Powershell, at https://docs.chef.io/dk_windows.html . I was driven slightly bonkers by difficulty loading cookbooks.

It remains forever confusing to me that the “knife cookbook upload” command needs a directory configured or command line selected to look inside for cookbooks, rather than having an option to “load the cookbook from this directory that is the cookbook.” option. I’ve never understood that requirement of the “knife cookbook” command.