bundlerEnv: fix wrapping of programs

Setting the GEM_PATH after ruby is started is not reliable enough. In
some cases rubygems would have already loaded and ignore these settings.

Fixes #14048
This commit is contained in:
zimbatm 2016-03-19 20:25:34 +00:00
parent 25122f05b0
commit 53c9edef34

View File

@ -32,10 +32,8 @@ paths.each do |path|
ENV["BUNDLE_GEMFILE"] = "#{gemfile}"
ENV["BUNDLE_PATH"] = "#{bundle_path}"
gem_path = ENV["GEM_PATH"]
ENV["GEM_PATH"] = "\#{gem_path}\#{":" unless gem_path.nil? || gem_path.empty?}#{bundler_gem_path}"
Gem.use_paths("#{bundler_gem_path}", ENV["GEM_PATH"])
require 'rubygems'
require 'bundler/setup'
load Gem.bin_path(#{name.inspect}, #{exe.inspect})