Vagrant Berkshelf在你的PATH中找不到'berks'可执行文件。在运行'vagrant up'时

时间:2015-01-16 20:06:21

标签: vagrant vagrantfile chefdk

$ vagrant up
Bringing machine 'district' up with 'virtualbox' provider...
Vagrant Berkshelf could not find the 'berks' executable in your PATH.

Please download and install the latest version of the ChefDK from:

    https://downloads.getchef.com/chef-dk

and follow the installation instructions. Do not forget to add the ChefDK to
your PATH.
  • 我按照指示下载了最新版本的ChefDK。
  • 如何在vagrant文​​件中添加Berkshelf的路径?

这是我目前的Vgrant文​​件:

$ cat Vagrantfile
# vi: set ft=ruby :

    Vagrant.configure('2') do |config|
      config.vm.define 'district' do |app|
        app.vm.box = 'ubuntu/trusty64'

        app.vm.provider 'virtualbox' do |v|
          v.memory = 1024
          v.name = 'district'
        end

        app.ssh.forward_agent = true
        app.vm.network :forwarded_port, guest: 4567, host: 4567

        app.vm.synced_folder './', '/home/vagrant/WhatsMyDistrict'

        app.berkshelf.enabled = true

        app.vm.provision :chef_solo do |chef|
          chef.log_level = :debug
          chef.custom_config_path = 'chef_solo.config'
          chef.run_list = ['whatsmydistrict::default']
        end
      end
    end

2 个答案:

答案 0 :(得分:2)

确保您已将/opt/chefdk/bin添加到$PATH

建议在任何红宝石路径位置之前使用它 - 前置是确保这一点的最简单方法。

export PATH=/opt/chefdk/bin:$PATH

答案 1 :(得分:0)

对于 Windows 用户,ChefDK 安装在 C:\opscode\chefdk\bin 中,如 here 所述。

所以你必须写这个命令行: export PATH=/c/opscode/chefdk/bin:$PATH

您也可以按照这些 steps 添加路径 C:\opscode\chefdk\bin。您可能需要重新启动计算机才能应用更改。