[MacRuby] #448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class)
#448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class) -----------------------------------+---------------------------------------- Reporter: logan@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- From e-mail exchange: Hi Logan, Looks like a 32-bit only issue. $ arch -i386 macirb /usr/local/bin/macirb:in `<main>': undefined method `bind' for IRB::SLex:Class (NoMethodError) Could you file a ticket on Trac about this? This way we won't forget. Thanks, Laurent On Nov 22, 2009, at 3:53 PM, Logan Bowers wrote: Hello, I just downloaded and installed 0.5b2, however macirb fails to start; I get the following: bender:~ logan$ macirb /usr/local/bin/macirb:in `<main>': undefined method `bind' for IRB::SLex:Class (NoMethodError) bender:~ logan$ After doing a little digging, the culprit appears to be in e2mmap.rb: module Exception2MessageMapper @RCS_ID='-$Id: e2mmap.rb,v 1.10 1999/02/17 12:33:17 keiju Exp keiju $-' E2MM = Exception2MessageMapper def E2MM.extend_object(cl) super STDERR.puts("About to bind on #{cl.inspect}") # <---Line I added for debugging cl.bind(self) unless cl < E2MM # <--- Exception is raised here! end def bind(cl) self.module_eval %[ def Raise(err = nil, *rest) Exception2MessageMapper.Raise(self.class, err, *rest) end alias Fail Raise def self.included(mod) mod.extend Exception2MessageMapper end ] end With the debugging line above, I see: bender:~ logan$ macirb About to bind on IRB::Notifier About to bind on IRB::SLex /usr/local/bin/macirb:in `<main>': undefined method `bind' for IRB::SLex:Class (NoMethodError) bender:~ logan$ Given that the 'bind' method is defined 3 lines later, I can't see why the call would succeed for IRB::Notifier and not for IRB::SLex. Any ideas on what's going on? FWIW, I'm running SL on a 32-bit machine. Thanks! Logan Bowers _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel -- Ticket URL: <http://www.macruby.org/trac/ticket/448> MacRuby <http://macruby.org/>
#448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class) -----------------------------------+---------------------------------------- Reporter: logan@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Comment(by ernest.prabhakar@…): FYI, I've reduced it down to a case which throws the error: require "e2mmap" module IRB class SLex extend Exception2MessageMapper end end and one which does NOT: require "e2mmap" module IRB module Notifier extend Exception2MessageMapper end end Looks having a "class" rather than "module" is the kicker. -- Ticket URL: <http://www.macruby.org/trac/ticket/448#comment:2> MacRuby <http://macruby.org/>
#448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class) -----------------------------------+---------------------------------------- Reporter: logan@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Comment(by ernest.prabhakar@…): Yes, I still get it with the nightly on my 32-bit machine: il0304b-dhcp27:irb ernest$ macirb /usr/local/bin/macirb:in `<main>': undefined method `bind' for IRB::SLex:Class (NoMethodError) il0304b-dhcp27:irb ernest$ uname -a Darwin il0304b-dhcp27.apple.com 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386 il0304b-dhcp27:irb ernest$ sw_vers ProductName: Mac OS X ProductVersion: 10.6.2 BuildVersion: 10C540 -- Ticket URL: <http://www.macruby.org/trac/ticket/448#comment:3> MacRuby <http://macruby.org/>
#448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class) -----------------------------------+---------------------------------------- Reporter: logan@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Comment(by conradwt@…): The rules for using extend and include are as follows: {{{ # (1) include can be used in the context of a class or module # include in the context of a module: module A end module B include A end # include in the context of a class: module C end class D include C end # (2) extend can be used in the context of a class or object # extend in the context of a class: module E end class F extend E end # extend in the context of an object: module G end class H end object = H.new object.extend( G ) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/448#comment:4> MacRuby <http://macruby.org/>
#448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class) -----------------------------------+---------------------------------------- Reporter: logan@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Comment(by ernest.prabhakar@…): Perhaps a complete red herring, but I wonder why object.c undefines extend_object on Class: http://svn.macosforge.org/repository/ruby/MacRuby/trunk/object.c rb_undef_method(rb_cClass, "extend_object"); -- Ticket URL: <http://www.macruby.org/trac/ticket/448#comment:5> MacRuby <http://macruby.org/>
#448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class) -----------------------------------+---------------------------------------- Reporter: logan@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Comment(by lsansonetti@…): #extend_object is defined on Module. Class is a subclass of Module, but it is not intended to extend objects (in Ruby you can only mix modules, not classes). This is why Class#extend_object is undefined. -- Ticket URL: <http://www.macruby.org/trac/ticket/448#comment:6> MacRuby <http://macruby.org/>
#448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class) -----------------------------------+---------------------------------------- Reporter: logan@… | Owner: martinlagardette@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Changes (by lsansonetti@…): * owner: lsansonetti@… => martinlagardette@… Comment: Assigning to Thibault who will look at this for the next beta. -- Ticket URL: <http://www.macruby.org/trac/ticket/448#comment:7> MacRuby <http://macruby.org/>
#448: macirb fails to start on 32-bit arch (undefined method `bind' for IRB::SLex:Class) -----------------------------------+---------------------------------------- Reporter: logan@… | Owner: martinlagardette@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -----------------------------------+---------------------------------------- Changes (by pthomson@…): * status: new => closed * resolution: => fixed Comment: Fixed (on my 32-bit machine, running Snow Leopard) in r3121. It turns out that the problems were with the RCLASS_* macros on 32-bit. This fixed a lot of other crashes in 32-bit that I was running into, as well. -- Ticket URL: <http://www.macruby.org/trac/ticket/448#comment:8> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby