RubyGems 1.8.8 is broken on JRuby 1.6.3

Arthur Shagall's Avatar

Arthur Shagall

18 Aug, 2011 03:53 PM

After upgrading to 1.8.8 from 1.8.7 and trying to install a gem, you get the following error:
ERROR: While executing gem ... (ArgumentError)

wrong number of arguments (2 for 1)
  1. Support Staff 1 Posted by Luis Lavena on 18 Aug, 2011 03:58 PM

    Luis Lavena's Avatar

    Hello,

    When reporting problems, please include the complete output of gem env and also the complete output of the same gem command you executed, but with --debug -V options, so:

    gem install rails

    Turns into:

    gem install rails --debug -V

    Suggested is either you attach these files or use services like pastie.org or gist.github.com

    Help us help you better.

  2. 2 Posted by Arthur Shagall on 18 Aug, 2011 04:03 PM

    Arthur Shagall's Avatar

    ~$ gem env
    RubyGems Environment:
      - RUBYGEMS VERSION: 1.8.8
      - RUBY VERSION: 1.9.2 (2011-07-07 patchlevel 136) [java]
      - INSTALLATION DIRECTORY: /home/arthur/bin/jruby-1.6.3/lib/ruby/gems/1.9
      - RUBY EXECUTABLE: /home/arthur/bin/jruby/bin/jruby
      - EXECUTABLE DIRECTORY: /home/arthur/bin/jruby/bin
      - RUBYGEMS PLATFORMS:
        - ruby
        - universal-java-1.6
      - GEM PATHS:
         - /home/arthur/bin/jruby-1.6.3/lib/ruby/gems/1.9
         - /home/arthur/.gem/jruby/1.9
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :benchmark => false
         - :backtrace => false
         - :bulk_threshold => 1000
      - REMOTE SOURCES:
         - http://rubygems.org/

    ~$ export JRUBY_OPTS=--1.9; gem install json --debug -V
    GET http://rubygems.org/latest_specs.4.8.gz
    302 Found
    GET http://production.s3.rubygems.org/latest_specs.4.8.gz
    304 Not Modified
    Installing gem json-1.5.3-java
    ERROR: While executing gem ... (ArgumentError)
        wrong number of arguments (2 for 1)

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:57:in
    `initialize'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:64:in
    `each'
            org/jruby/RubyKernel.java:1419:in `loop'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in
    `each'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:35:in
    `initialize'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:20:in
    `open'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/package.rb:44:in
    `open'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/format.rb:62:in
    `from_io'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/format.rb:46:in
    `from_file_by_path'
            org/jruby/RubyIO.java:1111:in `open'
            org/jruby/RubyKernel.java:308:in `open'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/format.rb:45:in
    `from_file_by_path'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:119:in
    `format'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:129:in
    `spec'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:386:in
    `ensure_required_ruby_version_met'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:156:in
    `install'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:297:in
    `install'
            org/jruby/RubyArray.java:1603:in `each'
            org/jruby/RubyEnumerable.java:957:in `each_with_index'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:270:in
    `install'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:121:in
    `execute'
            org/jruby/RubyArray.java:1603:in `each'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115:in
    `execute'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/command.rb:278:in
    `invoke'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:147:in
    `process_args'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:117:in
    `run'

    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:65:in
    `run'
            /home/arthur/bin/jruby/bin/gem:21:in `(root)'
    Exception `Gem::SystemExitException' at
    /home/arthur/bin/jruby/lib/ruby/site_ruby/1.8/rubygems/user_interaction.rb:332
    - Exiting RubyGems with exit_code 1

  3. 3 Posted by Arthur Shagall on 18 Aug, 2011 04:07 PM

    Arthur Shagall's Avatar
  4. 4 Posted by Arthur Shagall on 18 Aug, 2011 04:25 PM

    Arthur Shagall's Avatar

    OK, the problem is here:
    https://github.com/rubygems/rubygems/commit/0825eb33a1f53ae6b5eee0c...

    JRuby:
    ~$ irb irb(main):001:0> require 'zlib'
    => true irb(main):002:0> Object.const_defined? :Encoding
    => true irb(main):003:0> Zlib::GzipReader.new("blah", "blah")
    ArgumentError: wrong number of arguments (2 for 1)

        from (irb):3:in `evaluate'
        from org/jruby/RubyKernel.java:1093:in `eval'
        from org/jruby/RubyKernel.java:1419:in `loop'
        from org/jruby/RubyKernel.java:1205:in `catch'
        from org/jruby/RubyKernel.java:1205:in `catch'
        from /home/arthur/bin/jruby/bin/irb:13:in `(root)'
    

    1.9.2-p290:
    ~$ irb ruby-1.9.2-p290 :001 > require 'zlib'
    => true ruby-1.9.2-p290 :002 > Object.const_defined? :Encoding
    => true ruby-1.9.2-p290 :003 > Zlib::GzipReader.new("blah", "blah")
    ArgumentError: wrong number of arguments (2 for 1)

        from (irb):3:in `initialize'
        from (irb):3:in `new'
        from (irb):3
        from /home/arthur/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
    
  5. Support Staff 5 Posted by Luis Lavena on 18 Aug, 2011 04:51 PM

    Luis Lavena's Avatar

    Please open a bug report here:

    https://github.com/rubygems/rubygems/issues

  6. 6 Posted by Arthur Shagall on 18 Aug, 2011 05:05 PM

    Arthur Shagall's Avatar
  7. Support Staff 7 Posted by Eric Hodel on 18 Aug, 2011 08:35 PM

    Eric Hodel's Avatar

    I rejected the github issue as the ZLib feature has existed since Ruby 1.9.1p0.

    I'll bring up the JRuby issue you filed at http://jira.codehaus.org/browse/JRUBY-6009 in hopes of getting it fixed faster.

  8. Eric Hodel closed this discussion on 18 Aug, 2011 08:35 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

23 Oct, 2014 05:37 PM
21 Oct, 2014 10:47 AM
18 Oct, 2014 08:39 PM
16 Oct, 2014 12:41 PM
06 Oct, 2014 02:30 PM