Vagrant Berkshelf插件错误:无法加载kernel_require.rb

时间:2016-12-10 00:11:04

标签: vagrant berkshelf vagrant-plugin

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

Vagrantfile

# -*- 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

Berksfile

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变量中。我该如何解决这个问题?

0 个答案:

没有答案