diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb index 0a657fdc1..84b667117 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb @@ -35,7 +35,14 @@ module Vagrant # Set the Bundler UI to be a silent UI. We have to add the # `silence` method to it because Bundler UI doesn't have it. - ::Bundler.ui = ::Bundler::UI.new + ::Bundler.ui = + if ::Bundler::UI.const_defined? :Silent + # bundler >= 1.6.0 + ::Bundler::UI::Silent.new + else + # bundler < 1.6.0 + ::Bundler::UI.new + end if !::Bundler.ui.respond_to?(:silence) ui = ::Bundler.ui def ui.silence(*args) diff --git a/vagrant.gemspec b/vagrant.gemspec index f75558a04..97bcbe0a0 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.required_rubygems_version = ">= 1.3.6" s.rubyforge_project = "vagrant" - s.add_dependency "bundler", "~> 1.5.2" + s.add_dependency "bundler", ">= 1.5.2", "< 1.7.0" s.add_dependency "childprocess", "~> 0.5.0" s.add_dependency "erubis", "~> 2.7.0" s.add_dependency "i18n", "~> 0.6.0"