diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 042a95d17..8d3abcc64 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -324,10 +324,13 @@ module Vagrant return @root_path if defined?(@root_path) root_finder = lambda do |path| - vagrantfile_name.each do |rootfile| - return path if File.exist?(File.join(path.to_s, rootfile)) + # Note: To remain compatible with Ruby 1.8, we have to use + # a `find` here instead of an `each`. + found = vagrantfile_name.find do |rootfile| + File.exist?(File.join(path.to_s, rootfile)) end + return path if found return nil if path.root? || !File.exist?(path) root_finder.call(path.parent) end diff --git a/lib/vagrant/util/counter.rb b/lib/vagrant/util/counter.rb index 75d1fde84..0114202ee 100644 --- a/lib/vagrant/util/counter.rb +++ b/lib/vagrant/util/counter.rb @@ -1,3 +1,5 @@ +require 'thread' + module Vagrant module Util # Atomic counter implementation. This is useful for incrementing