From a1460473cb921cb40e22848a844636ab46a44dfb Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sun, 12 Jun 2016 13:28:02 +0100 Subject: [PATCH] buildRubyGem: don't set the GEM_HOME bundler for example needs to have the GEM_HOME being passed trough to function properly. For gems that are loading content dynamically, or can use plugins, use buildRubyGem. For executables that are wrapped in their own sealed thing use bundlerEnv. --- pkgs/development/ruby-modules/gem/gem-post-build.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/ruby-modules/gem/gem-post-build.rb b/pkgs/development/ruby-modules/gem/gem-post-build.rb index 4480c525bf1..f0322b67f61 100644 --- a/pkgs/development/ruby-modules/gem/gem-post-build.rb +++ b/pkgs/development/ruby-modules/gem/gem-post-build.rb @@ -7,7 +7,7 @@ ruby = File.join(ENV["ruby"], "bin", RbConfig::CONFIG['ruby_install_name']) out = ENV["out"] bin_path = File.join(ENV["out"], "bin") gem_home = ENV["GEM_HOME"] -gem_path = ENV["GEM_PATH"].split(":") +gem_path = ENV["GEM_PATH"].split(File::PATH_SEPARATOR) install_path = Dir.glob("#{gem_home}/gems/*").first gemspec_path = ARGV[0] @@ -64,11 +64,16 @@ spec.executables.each do |exe| # this file is here to facilitate running it. # -Gem.use_paths "#{gem_home}", #{gem_path.to_s} - require 'rubygems' -load Gem.bin_path(#{spec.name.inspect}, #{exe.inspect}) +Gem.paths = { + 'GEM_PATH' => ( + ENV['GEM_PATH'].to_s.split(File::PATH_SEPARATOR) + + #{([gem_home] + gem_path).to_s} + ).join(File::PATH_SEPARATOR) +} + +load Gem.activate_bin_path(#{spec.name.inspect}, #{exe.inspect}, #{spec.version.to_s.inspect}) EOF end