From d98f2b45cbcd27d9b3477aca26e94c09fbc08ffe Mon Sep 17 00:00:00 2001 From: Pier-Hugues Pellerin Date: Mon, 2 Mar 2015 14:45:59 -0500 Subject: [PATCH] We need to call `bundler_setup!` before getting the list of the installed gems if we want to support the :path and :git option in the gemfile Fixes #2732 --- lib/logstash/environment.rb | 4 ++-- lib/logstash/pluginmanager/list.rb | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/logstash/environment.rb b/lib/logstash/environment.rb index 3f5b176bd..27e597112 100644 --- a/lib/logstash/environment.rb +++ b/lib/logstash/environment.rb @@ -94,8 +94,8 @@ module LogStash options = {:without => [:development]}.merge(options) options[:without] = Array(options[:without]) # make sure we use our own nicely installed bundler and not a rogue, bad, mean, ugly, stupid other bundler. bad bundler, bad bad bundler go away. - Gem.clear_paths - Gem.paths = ENV['GEM_HOME'] = ENV['GEM_PATH'] = logstash_gem_home + ::Gem.clear_paths + ::Gem.paths = ENV['GEM_HOME'] = ENV['GEM_PATH'] = logstash_gem_home # set BUNDLE_GEMFILE ENV before requiring bundler to avoid bundler recurse and load unrelated Gemfile(s) ENV["BUNDLE_GEMFILE"] = LogStash::Environment::GEMFILE_PATH diff --git a/lib/logstash/pluginmanager/list.rb b/lib/logstash/pluginmanager/list.rb index dd92e67be..d4d2a94f4 100644 --- a/lib/logstash/pluginmanager/list.rb +++ b/lib/logstash/pluginmanager/list.rb @@ -15,6 +15,9 @@ class LogStash::PluginManager::List < Clamp::Command end def execute + require 'logstash/environment' + LogStash::Environment.bundler_setup! + Gem.configuration.verbose = false gemfile = LogStash::Gemfile.new(File.new(LogStash::Environment::GEMFILE_PATH, "r+")).load