Make sure we setup the gem environment before finding the currently installed gems

Fixes #3063
This commit is contained in:
Pier-Hugues Pellerin 2015-04-21 10:12:23 -04:00 committed by Jordan Sissel
parent ba00a3805c
commit 6b671400cc

View file

@ -95,6 +95,7 @@ class LogStash::PluginManager::Update < LogStash::PluginManager::Command
# retrieve only the latest spec for all locally installed plugins
# @return [Hash] result hash {plugin_name.downcase => plugin_spec}
def find_latest_gem_specs
LogStash::Bundler.setup!
LogStash::PluginManager.find_plugins_gem_specs.inject({}) do |result, spec|
previous = result[spec.name.downcase]
result[spec.name.downcase] = previous ? [previous, spec].max_by{|s| s.version} : spec