我想將cookbook路徑設置到某個地方,以便我不需要每次(在vagrant init之後)修改Vagrantfile 。vagrantfile食譜路徑
我發現Vagrantfile負載幾個地方,所以我決定把我的食譜路徑信息 在〜/ .vagrant.d/Vagrantfile,(這個文件是Vagrantfile加載順序的第3),如:
...
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["D:/lib/chef/cookbooks"]
chef.add_recipe "dev::default"
end
...
但是當我提出一個新的虛擬機,並修改Vagrantfile(該文件是Vagrantfile加載順序的第4次):
...
config.vm.provision :chef_solo do |chef|
chef.add_recipe "torch"
end
...
錯誤:
[2013-02-28T03:23:36+00:00] ERROR: Running exception handlers
[2013-02-28T03:23:36+00:00] ERROR: Exception handlers complete
[2013-02-28T03:23:36+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-02-28T03:23:36+00:00] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook torch not found. If
you're loading torch from another cookbook, make sure you configure the dependency in your metadata
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
但我確定具體的食譜是在我的食譜路徑下。
我建議使用[圖書管理員 - 廚師](https://github.com/applicationsonline/librarian-chef)來管理你的食譜。 – allonhadaya 2013-04-22 07:49:42
謝謝,我稍後再試 – HaveF 2013-04-22 11:36:45