【问题标题】:Vagrant Berkshelf could not find the 'berks' executable in your PATH. When running 'vagrant up'Vagrant Berkshelf 在您的 PATH 中找不到“berks”可执行文件。运行“vagrant up”时
【发布时间】:2015-03-15 12:44:00
【问题描述】:
$ 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 的路径?

这是我当前的 Vgrantfile:

$ 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

【问题讨论】:

  • 向我们展示您的Vagrantfile
  • @BMW 编辑帖子以包含Vagrantfile

标签: vagrant vagrantfile chefdk


【解决方案1】:

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

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

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

【讨论】:

  • 对不起,我是一个真正的菜鸟,您能否详细说明如何在$PATH? 中添加一些内容?对不起,我真的很想了解我可以读到的内容这些东西比较熟悉?我只运行那个命令吗?
  • 是的,要将其他目录添加到您的 PATH,请使用上面的 export PATH= 命令。要永久添加到您的 PATH,请查看 this post。有关 PATH 变量的更多信息,请阅读this
  • 使用export PATH= 命令有效,我只需将/opt/chefdk/bin 部分替换为chefdk 存储在我的系统中的位置。
【解决方案2】:

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

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

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

【讨论】:

    猜你喜欢
    • 2017-12-13
    • 2016-09-04
    • 2016-07-06
    • 1970-01-01
    • 1970-01-01
    • 2023-04-11
    • 2015-04-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多