1

我正在尝试使用 vagrant 和 Vagrant Berkshelf 插件。我有一个带有 Vagrantfile 和 Berksfile 的项目目录:

流浪文件

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"

  config.berkshelf.berksfile_path = "Berksfile"
  config.berkshelf.enabled = true

  config.vm.provision "chef_solo" do |chef| 
     chef.add_recipe "java"
     chef.json = {
        :java => {
           :install_flavor => "oracle",
           :jdk_version => "8",
           :oracle => {
              :accept_oracle_download_terms => true
           }
        }
     }
  end
end

伯克斯文件

source 'https://supermarket.chef.io'

metadata
cookbook "java"

当我执行“vagrant up”时,我的控制台说它无法加载 kernel_require.rb 文件:

C:\HashiCorp\Vagrant\embedded\lib\ruby\2.2.0\rubygems\core_ext\kernel_require.rb:54:in 'require': cannot load such file -- bundler (LoadError)
from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/env.rb:1:in `<top (required)>'
    from C:/Users/smundra/.vagrant.d/gems/2.2.5/gems/vagrant-berkshelf-5.1.1/lib/vagrant-berkshelf/helpers.rb:62:in `berks'
    from C:/Users/smundra/.vagrant.d/gems/2.2.5/gems/vagrant-berkshelf-5.1.1/lib/vagrant-berkshelf/action/check.rb:33:in `berkshelf_version_check!'
    from C:/Users/smundra/.vagrant.d/gems/2.2.5/gems/vagrant-berkshelf-5.1.1/lib/vagrant-berkshelf/action/check.rb:16:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builtin/call.rb:53:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/warden.rb:34:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/builder.rb:116:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `block in run'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/util/busy.rb:19:in `busy'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/action/runner.rb:66:in `run'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/machine.rb:225:in `action_raw'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/machine.rb:200:in `block in action'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/environment.rb:567:in `lock'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/machine.rb:186:in `call'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/machine.rb:186:in `action'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.0/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

我已经确认该文件存在于我的计算机上的那个位置。我的 PATH 变量中也包含了这个文件。我该如何解决这个问题?

4

0 回答 0