[英]Vagrant / Chef-solo not working after running recipe rvm::vagrant
After adding recipe rvm::vagrant and running vagrant provision I got: 添加配方rvm :: vagrant并运行vagrant配置后,我得到了:
/usr/local/bin/chef-solo: line 23: /opt/vagrant_ruby/bin/chef-solo: No such file
or directory
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
This issue should have been fixed: https://github.com/fnichol/chef-rvm/issues/121 这个问题应该已修复: https : //github.com/fnichol/chef-rvm/issues/121
Even though I add the line: 即使我添加了这行:
'rvm' => {
'vagrant' => {
'system_chef_solo' => '/opt/vagrant_ruby/bin/chef-solo'
}
}
I am still getting the error. 我仍然得到错误。 How can I recover from it?
我该如何从中恢复?
You have to make sure that '/opt/vagrant_ruby/bin/chef-solo' is actual path of chef-solo
. 你必须确保“/选择/ vagrant_ruby /斌/厨师独奏”是的实际路径
chef-solo
。 In my case it was /usr/bin/chef-solo
. 在我的情况下,它是
/usr/bin/chef-solo
。 And this is part of my Vagrantfile
that fixed it: 这是我修复它的
Vagrantfile
一部分:
config.vm.provision :chef_solo do |chef|
chef.json.merge! rvm: {vagrant: {system_chef_solo: '/usr/bin/chef-solo'}}
end
This has been frustrating as answers are very time dependent. 由于答案非常依赖于时间,因此这令人沮丧。 I have had this issue though and fixed it today by adding to my Vagrantfile.
我有这个问题,今天通过添加到我的Vagrantfile修复它。 I had to
vagrant destroy
and vagrant up
again so hopefully this doesn't break next time I vagrant provision
but I have checked in the box and it looks like the path to chef-solo is correct. 我不得不再次将
vagrant destroy
并vagrant up
所以希望这不会在下次我vagrant provision
下vagrant destroy
,但我已经在盒子中检查了它,看起来像大厨独奏的路径是正确的。 Found this answer out on Github at here 在这里找到了Github的答案
chef.json = {
rvm: {
vagrant: {
system_chef_solo: '/opt/chef/bin/chef-solo'
},
user_installs: [
{
user: 'vagrant',
default_ruby: '2.2.1',
rubies: ['2.2.1'],
global: '2.2.1'
}
]
},
... rest of Vagrantfile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.