我的平台是windows。我使用chefdk-0.19.6-1-x86.msi安装了厨师开发杀戮。
然后使用Cygwin执行以下命令
echo 'eval "$(chef shell-init bash)"' >> ~/.bash_profile
将chef 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)
但是,当我尝试厨师时,它显示如下,任何人都可以帮助
$ chef
C:\opscode\chefdk\embedded\bin\ruby.exe: No such file or directory -- /cygdrive/c/opscode/chefdk/bin/chef (LoadError)
我也尝试过以下
$ echo 'export PATH="/opt/chefdk/embedded/bin:$PATH"' >> ~/.bash_profile && source ~/.bash_profile
C:\ opscode \ chefdk \ embedded \ bin \ ruby.exe:没有这样的文件或目录 - / cygdrive / c / opscode / chefdk / bin / chef(LoadError)
跟随以下链接
https://docs.chef.io/install_dk.html
任何人都可以帮我解决上述错误。将不胜感激。
答案 0 :(得分:3)
我在.bash_profile
中使用了许多别名条目,使其在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 :(得分:1)
仅仅是为了说明它,我们不会在Cygwin上测试我们的Windows软件包,也不鼓励使用Cygwin。如果你想要bash因为lolpowershell,只需使用本地为Windows编译的副本。我通常使用msysgit附带的那个,但其他地方也有很多构建。