0
votes

My platform is windows. I installed chef development kill using chefdk-0.19.6-1-x86.msi.

Then using Cygwin executed the below command

echo 'eval "$(chef shell-init bash)"' >> ~/.bash_profile

to set chef ruby as default

I don't have ruby

 $ which ruby
 which: no ruby in (/usr/local/bin:/usr/bin:/cygdrive/c/Perl/site/bin:/cygdrive/c/Perl/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/1E/NomadBranch:/cygdrive/c/Program Files (x86)/Microsoft Application Virtualization Client:/cygdrive/c/Program Files (x86)/Java/jre7/bin:/cygdrive/c/Program Files/McAfee/Solidcore/Tools/GatherInfo:/cygdrive/c/Program Files/McAfee/Solidcore/Tools/Scanalyzer:/cygdrive/c/Program Files/McAfee/Solidcore:/cygdrive/c/Program Files/McAfee/Solidcore/Tools/ScGetCerts:/cygdrive/c/Program Files/McAfee/Tools/GatherInfo:/cygdrive/c/Program Files/McAfee/Tools/Scanalyzer:/cygdrive/c/Program Files/McAfee:/cygdrive/c/Program Files/McAfee/Tools/ScGetCerts:/cygdrive/c/Program Files/apache-maven-3.3.9/bin:/cygdrive/c/Program Files/Amazon/AWSCLI:/cygdrive/c/Program Files/Git/cmd:/cygdrive/c/Program Files/apache-maven-3.3.9/bin:/cygdrive/c/opscode/chefdk/bin:/home/JBE624/.chefdk/gem/ruby/2.0.0/bin:/c/opscode/chefdk/embedded/bin:/home/JBE624/.chefdk/gem/ruby/2.0.0/bin:/c/opscode/chefdk/embedded/bin)

But when I am trying to chef it is showing as below can anyone help

$ chef
C:\opscode\chefdk\embedded\bin\ruby.exe: No such file or directory -- /cygdrive/c/opscode/chefdk/bin/chef (LoadError)

I also tried below

 $ echo 'export PATH="/opt/chefdk/embedded/bin:$PATH"' >> ~/.bash_profile && source ~/.bash_profile

C:\opscode\chefdk\embedded\bin\ruby.exe: No such file or directory -- /cygdrive/c/opscode/chefdk/bin/chef (LoadError)

followed below links

https://docs.chef.io/install_dk.html

Can anyone help me to solve the above error. Help will be appreciated.

2
Why do you want to use cygwin here ? just get rid of it and use the same command chef shell-init bash in a dos prompt and you'll be fineTensibai

2 Answers

3
votes

I use a number of alias entries in my .bash_profile to make it work in Cygwin.

alias knife='/cygdrive/c/opscode/chefdk/embedded/bin/ruby C:/opscode/chefdk/bin/knife'
alias chef-client='/cygdrive/c/opscode/chefdk/embedded/bin/ruby C:/opscode/chefdk/bin/chef-client'
alias chef-solo='/cygdrive/c/opscode/chefdk/embedded/bin/ruby C:/opscode/chefdk/bin/chef-solo'
alias shef='/cygdrive/c/opscode/chefdk/embedded/bin/ruby C:/opscode/chefdk/bin/shef'
alias chef='/cygdrive/c/opscode/chefdk/embedded/bin/ruby C:/opscode/chefdk/bin/chef'
1
votes

Just for the sake of stating it, we don't test our Windows packages on Cygwin nor do we encourage use with Cygwin. If you want bash because lolpowershell, just use a copy compiled for Windows natively. I usually use the one that comes with msysgit but there are plenty of builds elsewhere too.