Skip to content


gem pristine does not observe installer options #119

zenspider opened this Issue · 2 comments

4 participants


From (and possibly other places too)

In pristine_command.rb, there are the following lines:

  # TODO use installer options
  installer = gem, :wrappers => true, :force => true

Obviously it was intended that this code eventually propagate installer options, but it has never been done. Unfortunately rvm's gemset support uses gem pristine --all, which on JRuby will lose the --env-shebang default we require to allow using jruby's bash-based startup script in shebang likes for installed gem executables. This led to the following bug report:

After a short exploration, I could not find the proper way to propagate installer options for pristine installs, so I ended up going with the following patch. RubyGems should be fixed to propagate installer options appropriately.

diff --git a/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
index ef11129..61897cc 100644
--- a/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
+++ b/lib/ruby/site_ruby/1.8/rubygems/commands/pristine_command.rb
@@ -82,7 +82,11 @@ revert the gem.

       # TODO use installer options
-      installer = gem, :wrappers => true, :force => true
+      # Modified for JRUBY-5031, to propagate --env-shebang if set
+      installer = gem,
+        :wrappers => true,
+        :force => true,
+        :env_shebang => !Gem::ConfigFile::PLATFORM_DEFAULTS['install'].to_s['--env-shebang'].nil?

       say "Restored #{spec.full_name}"
@zenspider zenspider was assigned
@krainboltgreene krainboltgreene removed this from the Future milestone
RubyGems member

This was made to propagate env_shebang in de8afc4 and then to propagate build_args in 488c20c — does that resolve this issue?


@duckinator Yes de8afc4 is logically the same as @zenspider's patch. So closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.