require 'active_rdf' causes superclass mismatch for class DateTime

Bug #202979 reported by Slava Kravchenko
2
Affects Status Importance Assigned to Milestone
ActiveRDF
Fix Committed
Medium
Eyal Oren

Bug Description

To make it brief, here's the code and backtrace extract:

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'active_rdf'
TypeError: superclass mismatch for class DateTime
 from /usr/lib/ruby/1.8/date/format.rb:1054
 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
[...]
 from /usr/lib/ruby/gems/1.8/gems/activerdf-1.6.9/lib/active_rdf.rb:68
 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
 from (irb):2

I figure, it doesn't like this declaration in "objectmanager/literal.rb:42":
  class DateTime; include Literal; end
... which happens before "date/format.rb:1054":
  class DateTime < Date
because "literal.rb" is required before the first "require 'time'" (in "open-uri.rb").
I wonder why it seems never to have happened with the rest of developers. My configuration doesn't look special to me.

As a workaround, requiring "time" the first thing in your code solves this problem:

irb(main):001:0> require 'time'
=> true
irb(main):002:0> require 'rubygems'
=> true
irb(main):003:0> require 'active_rdf'
=> true

So there.

Here's the configuration:

activerdf - 1.6.9
activerdf_sparql - 1.3.5
rubygems - 1.0.1
ruby - 1.8.6
(OS: Debian Linux)

Revision history for this message
Eyal Oren (ikbeneyal) wrote :

I haven't seen this before, but I recently started seeing a 'constant already initialized' warning regarding date/format.rb, which is probably related to this bug. It must be something new in the date stdlib. I'll have a look at what's going on. What ruby version are you on?

Changed in activerdf:
assignee: nobody → ikbeneyal
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Slava Kravchenko (cordawyn) wrote :

I wrote it at the bottom of my message:

activerdf - 1.6.9
activerdf_sparql - 1.3.5
rubygems - 1.0.1
ruby - 1.8.6
(OS: Debian Linux)

Revision history for this message
Eyal Oren (ikbeneyal) wrote :

Sorry, took me a while to realise, fixed now.
Probably something changed in the Ruby distribution recently, I had never seen this before.

Changed in activerdf:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.