流浪厨师,找不到文件夹

Chef Vagrant, Can't Find Folder

大厨真是把我搞糊涂了。你能帮我理解为什么它不起作用吗?

悬崖笔记

Vagrant SSH 内部错误:

注意:文件没有指向 .chef 文件夹,但它们在这里?

[2015-01-30T16:23:44+00:00] WARN: Did not find config file: 
/etc/chef/solo.rb, using command line options.

[2015-01-30T16:23:50+00:00] FATAL: None of the cookbook paths set in
Chef::Config[:cookbook_path], 
["/vagrant/.chef/cookbooks", "/vagrant/.chef/site-cookbooks"], 
contain any cookbooks

$vagrant up 和 $vagrant provision 错误:

==> default: Mounting shared folders...
default: /vagrant => /home/jesse/if/indieflix/vagrant
default: /home/vagrant/chef-recipes => /home/jesse/projects/if/vagrant/chef-recipes
default: /home/vagrant/chef-resources => /home/jesse/projects/if/vagrant/chef-resources

==> default: Running provisioner: chef_solo...
==> default: Detected Chef (latest) is already installed
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.

而且,vagrant reload什么都不做。

Vagrantfile

# ...
config.vm.synced_folder "chef-recipes", "/vagrant/chef-recipes"
config.vm.synced_folder "chef-resources", "/vagrant/chef-resources"
# ...
config.vm.provision "chef_solo" do |chef|
    # Relevant to the Vagrantfile path
    chef.cookbooks_path = ["chef-recipes"]

    # This is just required by Chef, so it's minimal
    chef.environments_path = "chef-resources/environments"

    # This is the internal flag.
    chef.environment = "development"

    # This defines the cookbooks to run
    chef.roles_path = "chef-resources/roles"
    chef.add_role("development")
end

文件夹结构

chef-recipes/    (Git Submodule)
----python/
--------recipes/
------------default.rb
------------pip.rb
chef-resouces/   (Git Submodule)
----environments/
--------development.json
----roles/
--------development.json
Vagranfile

Anthony 在评论中建议我回答我的问题,因为它在评论中得到了回答。在这里!

我没有使用 curl 安装,而是使用了 omnibus,它在配置之前添加了另一个步骤:

$ vagrant plugin install vagrant-omnibus 

其次,Chef-Solo/Vagrant 从主机加载文件时出现问题。我找到的唯一解决方法是:

$ rm .vagrant/machines/default/virtualbox/synced_folders vagrant reload --provision 

可选: 我创建了一个 bash 脚本来使上面的操作更快一些:

reprovision.sh

#/bin/bash
rm .vagrant/machines/default/virtualbox/synced_folders
vagrant reload --provision

当然还有 chmod +x reprovision.sh 和 运行 ./reprovision.sh