Question about "TypeError: can't convert Hash into Integer" in rubygems on JRuby 1.6.2

Hello,

I am trying upgrade my JRuby (on Rails)
environment version from 1.4.0 to 1.6.2.
(I was running JRuby in 1.8 mode, not 1.9 mode.)
During this work, following errors are occured.

TypeError: can’t convert Hash into Integer

This problem is solved by manually removing ‘, :encoding => “UTF-8”’
in lib/ruby/site_ruby/1.8/rubygems/specification.rb
===part of “def self.load file”===
code = if defined? Encoding
File.read file, :encoding => “UTF-8”
else
File.read file
end

Is there any good solution about this issue?

As you know, JRuby 1.6.2 includes rubygems 1.5.1 already.
I previously used JRuby 1.4.0 with rubygems-update 1.3.5.

For more info related this issue is following URL (This comes from my
guessing)
http://www.ruby-forum.com/topic/211568
Re: script/server vs mongrel_rails start issue
Posted by Maxim Shytikov (Guest) on 2010-06-17 16:22

Thanks
Atsushi SAKAI

Since this seems rubyspec problem,
I posted to rubygems on this issue.
http://help.rubygems.org/discussions/questions/72-about-utf-8-handling-on-rubygems-on-cruby-18-mode-in-jruby

Thanks
Atsushi SAKAI

On Tue, 5 Jul 2011 15:22:26 +0900
Atsushi SAKAI [email protected] wrote:

This problem is solved by manually removing ‘, :encoding => “UTF-8”’

Thanks
Atsushi SAKAI


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Atsushi SAKAI [email protected]

This isn’t just a problem in jruby.

This is also occurring with ruby 1.8.7 (2009-06-12 patchlevel 174)
[universal-darwin10.0], the parameter aren’t valid for ruby 1.8.

For such a fundamental part of the ruby stack, such a simple bug should
never of been released, wasted many hours figuring this out.

Every single time I upgrade in ruby land stuff breaks, just unlucky or
is there a quality issue!