RubyGems 1.8.8 does not work with JRuby 1.6.3. #157

albertosaurus opened this Issue Aug 18, 2011 · 5 comments


None yet

4 participants


The problem is introduced with this commit: 0825eb3#diff-0

JRuby does not handle *args as expected:*args)
ArgumentError: wrong number of arguments (2 for 1)
        from (irb):5:in `evaluate'
        from org/jruby/ `eval'
        from org/jruby/ `loop'
        from org/jruby/ `catch'
        from org/jruby/ `catch'
@drbrain drbrain was assigned Aug 18, 2011
RubyGems member

@drbrain, seems the Encoding change is affecting JRuby?


Also filed a bug with JRuby:

Not sure where the fix should be, as the ability to pass an arguments hash to is an undocumented feature of 1.9.2. only shows the "io" as the only parameter to "new", but source says
if (argc > 1) {
opt = rb_check_convert_type(argv[argc-1], T_HASH, "Hash", "to_hash");
if (!NIL_P(opt)) argc--;

RubyGems member

The second argument of ZLib::GzipReader exists back to Ruby 1.9.1p0.

Since this is not new feature of Ruby 1.9.2 nor a Ruby 1.9.2 patchlevel a workaround for non-compliant Ruby implementations won't be added to RubyGems.

@drbrain drbrain closed this Aug 18, 2011

A hack, then, to workaround this issue until Ruby and RubyGems get along:

    # Strip superfluous args from Zlib::GzipReader instantiation:
    if defined? RUBY_ENGINE and 
       RUBY_ENGINE == 'jruby' and
       JRUBY_VERSION =~ /\A1.6.[0123]\Z/ and
       RUBY_VERSION =~ /\A1.9.[12]\Z/ then
      module Zlib
        class GzipReader
          alias :old_initialize :initialize
          def initialize *args
            old_initialize [*args][0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment