require 'active_rdf' causes superclass mismatch for class DateTime
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/
from /usr/local/
[...]
from /usr/lib/
from /usr/local/
from /usr/local/
from (irb):2
I figure, it doesn't like this declaration in "objectmanager/
class DateTime; include Literal; end
... which happens before "date/format.
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)
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?