rubygems_etc.patch 948 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- jruby/lib/ruby/shared/rubygems/config_file.rb
  2. +++ jrub-fix/lib/ruby/shared/rubygems/config_file.rb
  3. @@ -25,6 +25,8 @@
  4. # +:sources+:: Sets Gem::sources
  5. # +:verbose+:: See #verbose
  6. +require 'rbconfig'
  7. +
  8. class Gem::ConfigFile
  9. DEFAULT_BACKTRACE = false
  10. @@ -68,7 +70,7 @@
  11. path.strip
  12. rescue LoadError
  13. - "/etc"
  14. + RbConfig::CONFIG["sysconfdir"] || "/etc"
  15. end
  16. end
  17. --- jruby/bin/jgem
  18. +++ jruby-fix/bin/jgem
  19. @@ -9,6 +9,15 @@
  20. # See LICENSE.txt for permissions.
  21. #++
  22. +# The prelude in 1.9.1 injects rubygems.rb into $LOADED_FEATURES
  23. +# which prevents the `require 'rubygems'` from actually loading
  24. +# the site's version of rubygems. So we have to use it's API
  25. +# to get it's prelude out of the way.
  26. +#
  27. +if RUBY_VERSION =~ /^1\.9\.1/ && defined?(Gem::QuickLoader)
  28. + Gem::QuickLoader.load_full_rubygems_library
  29. +end
  30. +
  31. require 'rubygems'
  32. require 'rubygems/gem_runner'
  33. require 'rubygems/exceptions'