fix the issue caused by jruby-kafka that prevent to run the packaging

Fixes #3393
This commit is contained in:
Pere Urbon-Bayes 2015-06-08 17:50:40 +02:00 committed by Jordan Sissel
parent d2a82b6a77
commit 0d82ae87c1
2 changed files with 7 additions and 1 deletions

View file

@ -34,7 +34,6 @@ end
if $0 == __FILE__
begin
LogStash::Bundler.setup!({:without => [:build, :development]})
LogStash::PluginManager::Main.run("bin/plugin", ARGV)
rescue LogStash::PluginManager::Error => e
$stderr.puts(e.message)

View file

@ -4,6 +4,13 @@ class LogStash::PluginManager::Uninstall < LogStash::PluginManager::Command
def execute
signal_error("File #{LogStash::Environment::GEMFILE_PATH} does not exist or is not writable, aborting") unless File.writable?(LogStash::Environment::GEMFILE_PATH)
##
# Need to setup the bundler status to enable uninstall of plugins
# installed as local_gems, otherwise gem:specification is not
# finding the plugins
##
LogStash::Bundler.setup!({:without => [:build, :development]})
# make sure this is an installed plugin and present in Gemfile.
# it is not possible to uninstall a dependency not listed in the Gemfile, for example a dependent codec
signal_error("This plugin has not been previously installed, aborting") unless LogStash::PluginManager.installed_plugin?(plugin, gemfile)