[MacRuby] #134: require 'rexml/document' fails
#134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@googlemail.com | Owner: lsansonetti@apple.com Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- In the course of trying to get soap4r to work I've hit this problem: $ macirb
require 'rexml/document' NameError: uninitialized constant REXML::Attribute::NAME_STR from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/attribute.rb:18:in `<class:Attribute>' from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/attribute.rb:9:in `<module:REXML>' from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/attribute.rb:4:in `<top (required)>' from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/element.rb:3:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/element.rb:3:in `<top (required)>' from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/document.rb:1:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.3/usr/lib/ruby/1.9.0/rexml/document.rb:1:in `<top (required)>' from (irb):1:in `require' from (irb):1 from /usr/local/bin/macirb:12:in `<main>'
-- Ticket URL: <http://www.macruby.org/trac/ticket/134> MacRuby <http://macruby.org/>
#134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@googlemail.com | Owner: lsansonetti@apple.com Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Resolution: Keywords: | ------------------------------------+--------------------------------------- Comment(by masterkain@gmail.com): Same on trunk {{{
require 'rexml/document' NameError: uninitialized constant REXML::Attribute::NAME_STR from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/rexml/attribute.rb:18:in `<class:Attribute>' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/rexml/attribute.rb:9:in `<module:REXML>' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/rexml/attribute.rb:4:in `<top (required)>' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/rexml/element.rb:3:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/rexml/element.rb:3:in `<top (required)>' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/rexml/document.rb:1:in `require' from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/1.9.0/rexml/document.rb:1:in `<top (required)>' from (irb):1:in `require' from (irb):1 from /usr/local/bin/macirb:12:in `<main>'
}}} -- Ticket URL: <http://www.macruby.org/trac/ticket/134#comment:1> MacRuby <http://macruby.org/>
#134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@googlemail.com | Owner: lsansonetti@apple.com Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Resolution: Keywords: | ------------------------------------+--------------------------------------- Comment(by isc@massivebraingames.com): Here is a reduction of the bug causing the failure: {{{ module A module B CONST1 = "cool" end module C include B end class D include C CONST2 = CONST1 end end }}} Hope it'll help. -- Ticket URL: <http://www.macruby.org/trac/ticket/134#comment:2> MacRuby <http://macruby.org/>
#134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by stephane@…): Hi, I confirm this bug in the last stable 0.4, Hope it'll help -- Ticket URL: <http://www.macruby.org/trac/ticket/134#comment:3> MacRuby <http://macruby.org/>
#134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by mattaimonetti@…): As a work around, the following works: {{{ module A module B CONST1 = "cool" end module C include B end class D include C CONST2 = A::B::CONST1 end end }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/134#comment:4> MacRuby <http://macruby.org/>
#134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by mattaimonetti@…): Because the constants are not inherited properly, we need to reopen the Attribute class and include the module defining the constants we are after. You can use the following hack to get rexml working until this problem gets resolved: {{{ require 'rexml/xmltokens' module REXML class Attribute include ::REXML::XMLTokens end end }}} You can put the hotpatch in a ruby file and require it before loading rexml/client or rexml/document. - Matt -- Ticket URL: <http://www.macruby.org/trac/ticket/134#comment:5> MacRuby <http://macruby.org/>
#134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ------------------------------------+--------------------------------------- Comment(by simonis.christophe@…): Replying to [comment:3 stephane@…]:
Hi, I confirm this bug in the last stable 0.4,
Hope it'll help But it's works with the last snapshot of the experimental branch.
-- Ticket URL: <http://www.macruby.org/trac/ticket/134#comment:6> MacRuby <http://macruby.org/>
#134: require 'rexml/document' fails ------------------------------------+--------------------------------------- Reporter: rebotfc@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------------+--------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.5 Comment: I confirm that it's working with trunk. Not sure if the rest of REXML is working though. -- Ticket URL: <http://www.macruby.org/trac/ticket/134#comment:7> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby