From 52b61dce4784b561792b180b593eab4ae602e14d Mon Sep 17 00:00:00 2001 From: Allan Espinosa Date: Wed, 16 Mar 2016 17:28:02 -0500 Subject: [PATCH] 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 --- .../interpreters/ruby/build-ruby-gem/gem-post-build.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/ruby/build-ruby-gem/gem-post-build.rb b/pkgs/development/interpreters/ruby/build-ruby-gem/gem-post-build.rb index 112a9accc33..4480c525bf1 100644 --- a/pkgs/development/interpreters/ruby/build-ruby-gem/gem-post-build.rb +++ b/pkgs/development/interpreters/ruby/build-ruby-gem/gem-post-build.rb @@ -64,8 +64,7 @@ spec.executables.each do |exe| # this file is here to facilitate running it. # -gem_path = ENV["GEM_PATH"] -ENV["GEM_PATH"] = "\#{gem_path}\#{":" unless gem_path.nil? || gem_path.empty?}#{(gem_path+[gem_home]).join(":")}" +Gem.use_paths "#{gem_home}", #{gem_path.to_s} require 'rubygems'