[Rubygems-developers] rubygems 0.9.0.9 beta time?

Michael Studman me at michaelstudman.com
Sun Jan 7 17:35:16 EST 2007


 >>Michael, could you give the new version a try under JRuby? You can
 >> get it with:

 > Will do. I'm away from my development box right now but will check it
 > tonight when I get back home. I'll let you know how I go.
 > gem update --system --source http://onestepback.org/betagems


gem update --system doesn't seem to work on JRuby, at least not for me. 
Not sure why but I seem to remember this happening before. So the way I 
tested this was by replacing the contents of site_ruby/1.8 with lib for 
0.9.0.9. With that in mind...

So first the good news. The new code seems to stop the rather annoying 
problem of bad gem specs halting any gem action under JRuby every single 
time. I was able to install and update various gems without much of a 
hassle.

The bad news is that there is still at least one gem that seems to have 
a problems and Specification#hash trips up on it. It's not fatal as it 
doesn't occur every time, just one in every four or five gem actions.

I'm not in a position until tomorrow to debug this further (I don't know 
which spec is causing the problem) but here's what I know so far.

The stack trace for the TypeError is below. It seems something is a Time 
object when RubyGems expects a String:

~ michaelstudman$ gem --backtrace update
Updating installed gems...
ERROR:  While executing gem ... (TypeError)
   can't convert Time into String
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/specification.rb:355:in
`join'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/specification.rb:355:in
`add_bindir'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/specification.rb:366:in
`map'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/specification.rb:356:in
`add_bindir'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/specification.rb:366:in
`test_files'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems.rb:504:in
`files'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:125:in
`send'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:125:in
`hash'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:125:in
`inject'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/specification.rb:551:in
`hash'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:125:in
`dump'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:125:in
`write_cache'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:96:in
`open'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:126:in
`write_cache'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:96:in
`flush'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:96:in
`refresh'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:39:in
`cache'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/source_info_cache.rb:49:in
`search'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/gem_commands.rb:965:in
`execute'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/command.rb:70:in
`invoke'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:120:in
`process_args'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:91:in
`run'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:30:in
`run'
/Users/michaelstudman/Projects/jruby_sandbox/jruby-0.9.2/bin/gem:23

The following method from Specification is implicated:

   def add_bindir(executables)
     if not defined? @executables or @executables.nil? then
       return nil
     end

     if defined? @bindir and @bindir then
       @executables.map {|e| File.join(@bindir, e) }
     else
       @executables
     end
   end

Seems like either @bindir is a Time instance or one of @executables.

I'll let you know tomorrow which gem is the culprit.

Michael.


More information about the Rubygems-developers mailing list