buildRubyGem: use Gem.use_paths to load gems
After ruby initializes, rubygems no longer reads the GEM_PATH. Before, we have the following scenario: Gem.path # => ["a"] ENV['GEM_PATH'] = ["b"] Gem.path # => ["a"] # Still returns the same Gem.use_paths is the documented way to create isolated environments as documented in [1]. [1] http://www.rubydoc.info/github/rubygems/rubygems/Gem.use_paths
This commit is contained in:
parent
c2013ea4ec
commit
52b61dce47
@ -64,8 +64,7 @@ spec.executables.each do |exe|
|
|||||||
# this file is here to facilitate running it.
|
# this file is here to facilitate running it.
|
||||||
#
|
#
|
||||||
|
|
||||||
gem_path = ENV["GEM_PATH"]
|
Gem.use_paths "#{gem_home}", #{gem_path.to_s}
|
||||||
ENV["GEM_PATH"] = "\#{gem_path}\#{":" unless gem_path.nil? || gem_path.empty?}#{(gem_path+[gem_home]).join(":")}"
|
|
||||||
|
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user