2016-12-06 83 views
0

我試圖在我的本地Mac機器上自定義一個自定義框。由於VirtualBox版本的問題,我必須格式化並重新安裝OSx。我已經安裝了Chef DK,Vagrant並安裝了berkshelf插件。當我嘗試無業遊民,我得到以下錯誤:流浪者 - berks錯誤當試圖流浪時

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

我目前的設置是:

Vagrant Version 1.9.0 
Chef Development Kit Version: 1.0.3 
chef-client version: 12.16.42 
delivery version: master (83358fb62c0f711c70ad5a81030a6cae4017f103) 
berks version: 5.2.0 
kitchen version: 1.13.2 

vagrant-berkshelf (5.1.1) 
vagrant-omnibus (1.5.0) 
vagrant-share (1.1.6) 

當我在它運行的配方禁用berkshelf,但很明顯的依賴性不工作。

如果我降級berkshelf插件5.0.0,我得到一個不同的錯誤:

Bringing machine 'default' up with 'virtualbox' provider... 
/Users/cdelgado/.vagrant.d/gems/2.2.5/gems/vagrant-berkshelf-5.0.0/lib/vagrant-berkshelf/helpers.rb:62:in `berks': uninitialized constant VagrantPlugins::Berkshelf::Helpers::Bundler (NameError) 
    from /Users/cdelgado/.vagrant.d/gems/2.2.5/gems/vagrant-berkshelf-5.0.0/lib/vagrant-berkshelf/action/check.rb:33:in `berkshelf_version_check!' 
    from /Users/cdelgado/.vagrant.d/gems/2.2.5/gems/vagrant-berkshelf-5.0.0/lib/vagrant-berkshelf/action/check.rb:16:in `call' 

我一直沒有運氣,現在谷歌上搜索了好幾天,請大家幫忙。

+0

試試'vagrant plugin install bundler'? – coderanger

+0

謝謝,但現在它給出了一個不同的錯誤:'流浪漢未能在非常早的階段初始化: 插件未能正確加載。給出的錯誤信息是 ,如下所示。 找不到Gemfile或.bundle /目錄 –

+0

您可能需要將其從插件清單中移除,您希望保留已安裝的Gem,但不會嘗試將其作爲插件加載。 – coderanger

回答

1

經過多天與同事一起搜索,我們比較了我們的版本,並將問題縮小到Vagrant版本。我運行的是1.9.0,而且運行的是1.8.4。由於同樣的配方在他的機器上工作,我將Vagrant降級到他的版本,並且它的工作。我們仍然不知道具體的區別是什麼以及爲什麼會出現這個問題,但現在這會做。

我希望這有助於任何人陷入這個問題。

0

您需要升級或安裝您的vagrant-share插件。 運行此命令:

vagrant plugin install vagrant-share --plugin-version 1.1.8 

適應基於最新或所需的一個版本。

如果它不適合你(爲我工作),GitHub上有關於這個 here的問題。