我多次尝试让这段代码在我的Vagrantfile中运行,但都没有成功,每次我都得到以下错误消息:
There are errors in the configuration of this machine. Please fix
the following errors and try again:
chef solo provisioner:
* The following settings don't exist: add_recipe 下面是我所指的代码部分:
config.berkshelf.enabled = true
config.vm.provision :chef_solo do |chef|
chef.add_recipe = 'apache2'
end我已经从this site (version 1.2.2)下载了最新版本,并将.pgk文件安装在我的Mac机上,没有任何错误。
我还确保我已经成功地安装了chef-11.4.4,并在Vagrant box运行和未运行的情况下运行此程序。仍然会得到相同的错误。
我对这项技术是全新的,所以任何帮助和/或建议都将非常感谢。谢谢!
发布于 2013-06-20 00:48:49
add_recipe方法是一个常规方法,而不是一个访问器,即它不是add_recipe=。因此,您可以使用以下代码添加食谱:
config.vm.provision :chef_solo do |chef|
chef.add_recipe 'apache2'
end因此,您可以多次调用它来添加额外的配方(或将它们作为额外的参数添加)。
https://stackoverflow.com/questions/17181004
复制相似问题