RubyGems 1.8.8 is broken on JRuby 1.6.3
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)
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Luis Lavena on 18 Aug, 2011 03:58 PM
Hello,
When reporting problems, please include the complete output of
gem envand also the complete output of the same gem command you executed, but with--debug -Voptions, so:gem install railsTurns into:
gem install rails --debug -VSuggested is either you attach these files or use services like pastie.org or gist.github.com
Help us help you better.
3 Posted by Arthur Shagall on 18 Aug, 2011 04:03 PM
~$ 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
4 Posted by Arthur Shagall on 18 Aug, 2011 04:07 PM
Alternately:
https://gist.github.com/1154398
https://gist.github.com/1154400
5 Posted by Arthur Shagall on 18 Aug, 2011 04:25 PM
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)
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)
Support Staff 6 Posted by Luis Lavena on 18 Aug, 2011 04:51 PM
Please open a bug report here:
https://github.com/rubygems/rubygems/issues
7 Posted by Arthur Shagall on 18 Aug, 2011 05:05 PM
Done:
https://github.com/rubygems/rubygems/issues/157
Support Staff 8 Posted by Eric Hodel on 18 Aug, 2011 08:35 PM
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.
Eric Hodel closed this discussion on 18 Aug, 2011 08:35 PM.