From 6840da52f86f6b51a3f78a487adfdd497c76c1ca Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Fri, 27 Feb 2015 15:47:22 -0500 Subject: [PATCH] also set Gemfile path in ENV Fixes #2717 --- lib/logstash/environment.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/logstash/environment.rb b/lib/logstash/environment.rb index 1e573e148..b958d5d63 100644 --- a/lib/logstash/environment.rb +++ b/lib/logstash/environment.rb @@ -98,8 +98,13 @@ module LogStash require "logstash/bundler" ::Bundler.settings[:path] = LogStash::Environment::BUNDLE_DIR - ::Bundler.settings[:gemfile] = LogStash::Environment::GEMFILE_PATH ::Bundler.settings[:without] = "development" + + ::Bundler.settings[:gemfile] = LogStash::Environment::GEMFILE_PATH + # also set ENV because bundler does not check settings for :gemfile here + # https://github.com/bundler/bundler/blob/v1.8.3/lib/bundler/shared_helpers.rb#L103 + ENV["BUNDLE_GEMFILE"] = LogStash::Environment::GEMFILE_PATH + ::Bundler.reset! ::Bundler.setup end