厨师策略安装失败了(Mixlib :: ShellOut :: ShellCommandFail)
我是厨师的新手。最近几天,我正在研究厨师的政策。但是命令“厨师安装”失败了(mixlib :: shellout :: shellcommandfailed)。请看看和友好的帮助。谢谢 这是详细信息 -
我创建了一本名为“策略文件”样本的食谱 -
厨师生成食谱样本
它成功创建了食谱文件夹。
然后我创建了一个食谱-E.RB-在其中 -
文件'/tmp/e.sh'做 内容 ' #!/bin/bash cat /tmp/e.log dt =
日期 +%f“”%t
echo $ 1“” $ {dt}>> /tmp/e.log ' 模式'755' 结束然后CD回到Chef-Repo文件夹,我创建了另一本食谱 - 策略测试 -
厨师生成食谱策略测试-P
它也完成了。
这次,我在策略测试中修改了元数据.rb为 -
名称“策略测试” 维护者“作者” WEASTER_EMAIL' 许可“保留所有权利” 描述“安装/配置策略测试” 版本“ 0.1.0” Chef_version'> = 16.0'
取决于“样本”
和policyfile.rb-
name 'policytest'
default_source :supermarket
run_list 'policytest::default'
cookbook 'policytest', path: '.'
cookbook 'sample', path: '../sample'
然后我上传了两个食谱 -
刀食谱上传样本 刀食谱上传策略测试
全部成功完成。
然后,当我安装策略时会引起的错误 -
c:\ work \ chef-repo \ cookbooks>厨师安装politiontest \ policyfile.rb 构建策略测试扩展的运行列表: 食谱[PolicyTest ::默认]缓存食谱...安装策略测试
= 0.0.0从路径安装示例> = 0.0.0的路径错误:无法生成politationfile.lock原因: (mixlib :: shellout :: shellcommandfailed)期望退出 [0],但收到了“ 1” ----开始git smbolic-ref -q头的输出 - stdout:stderr:'git'不被识别为内部或外部命令,可操作 程序或批处理文件。 ---- GIT符号-REF -Q头的最终输出 - 返回git smbolic-ref -q头返回1
我无法在解决方案中搜索此错误。请帮助我获得我的错误 - 策略编码或我执行的过程?预先感谢您的任何想法。
I'm new to chef. Recent days, I'm studying policy in chef. But the command "chef install " failed with error (Mixlib::ShellOut::ShellCommandFailed). Please have a look and kind help. Thanks
Here's the details--
I create a cookbook named sample with policy file --
chef generate cookbook sample
It created the cookbook folder successfully.
Then I create a recipe -- e.rb -- in it --
file '/tmp/e.sh' do
content '
#!/bin/bash
cat /tmp/e.log
DT=date +%F" "%T
echo $1" "${DT} >> /tmp/e.log
'
mode '755'
endThen cd back to the chef-repo folder, I create another cookbook -- policytest --
chef generate cookbook policytest -P
It completed too.
This time, I modified the metadata.rb in policytest as --
name 'policytest'
maintainer 'The Authors'
maintainer_email '[email protected]'
license 'All Rights Reserved'
description 'Installs/Configures policytest'
version '0.1.0'
chef_version '>= 16.0'depends 'sample'
And the policyfile.rb --
name 'policytest'
default_source :supermarket
run_list 'policytest::default'
cookbook 'policytest', path: '.'
cookbook 'sample', path: '../sample'
Then I uploaded both cookbooks --
knife cookbook upload sample
knife cookbook upload policytestAll successfully completed.
Then the error raised when I install the policy --
C:\Work\chef-repo\cookbooks>chef install policytest\Policyfile.rb
Building policy policytest Expanded run list:
recipe[policytest::default] Caching Cookbooks... Installing policytest= 0.0.0 from path Installing sample >= 0.0.0 from path Error: Failed to generate Policyfile.lock Reason:
(Mixlib::ShellOut::ShellCommandFailed) Expected process to exit with
[0], but received '1'
---- Begin output of git symbolic-ref -q HEAD ---- STDOUT: STDERR: 'git' is not recognized as an internal or external command, operable
program or batch file.
---- End output of git symbolic-ref -q HEAD ---- Ran git symbolic-ref -q HEAD returned 1I can't search the solution for this error. Please kind help me to get what's my error -- either the policy coding or the process I executed? Thanks in advance for any idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来Git没有安装,请安装或将其指出路径。
Looks like Git is not installed, Please install it or point it out in path.