set BUNDLE_PATH env to overwrite any .bundler/config and fix Bundler.setup

Fixes #2449
This commit is contained in:
Colin Surprenant 2015-01-27 15:09:23 -05:00 committed by Jordan Sissel
parent 890c1bc3eb
commit 21270a2e07

View file

@ -56,13 +56,14 @@ module LogStash
# the bootstrap gems are required specificly for bundler which is a runtime dependency # the bootstrap gems are required specificly for bundler which is a runtime dependency
# of some plugins dependedant gems. # of some plugins dependedant gems.
def set_gem_paths! def set_gem_paths!
ENV["GEM_HOME"] = ENV["GEM_PATH"] = logstash_gem_home ENV["GEM_PATH"] = ENV["BUNDLE_PATH"] = logstash_gem_home
ENV["BUNDLE_GEMFILE"] = GEMFILE_PATH unless ENV['BUNDLE_GEMFILE'] ENV["BUNDLE_GEMFILE"] = GEMFILE_PATH unless ENV['BUNDLE_GEMFILE']
require 'bundler' require 'bundler'
require 'logstash/bundler_patch' require 'logstash/bundler_patch'
Bundler.setup Bundler.setup
ENV["GEM_HOME"] = ENV["GEM_PATH"] = logstash_gem_home
# Bundler.setup will wipe the existing $LOAD_PATH. # Bundler.setup will wipe the existing $LOAD_PATH.
# Since we are using gems not declared in the gemfile we need to # Since we are using gems not declared in the gemfile we need to