[MacRuby] #1192: Did not find nested constants.

MacRuby ruby-noreply at macosforge.org
Sat Mar 12 20:53:19 PST 2011


#1192: Did not find nested constants.
------------------------------+---------------------------------------------
 Reporter:  kouji@…           |       Owner:  lsansonetti@…        
     Type:  defect            |      Status:  new                  
 Priority:  blocker           |   Milestone:  MacRuby 0.10         
Component:  MacRuby           |    Keywords:                       
------------------------------+---------------------------------------------
 Hi,

 I try to run the Rails 3 on MacRuby.
 I get an error, see below.
 {{{
 $ macruby --version
 MacRuby 0.10 (ruby 1.9.2) [universal-darwin10.0, x86_64]
 $ macruby -rrubygems -ractive_support/dependencies -e '0'
 uninitialized constant Loadable (NameError)
 }}}

 I wrote a reduce code (test.rb).
 {{{
 module A
   B = 10

   def f
     Object.class_eval { p A::B } # <= OK
     Object.class_eval { p B } # <= NG in MacRuby
   end

   module_function :f
 end

 A.f
 puts("OK")
 }}}

 It run by MacRuby and cRuby.
 {{{
 $ macruby -v test.rb
 MacRuby 0.10 (ruby 1.9.2) [universal-darwin10.0, x86_64]
 10
 /Users/kouji/work/MacRuby/work/demo/test.rb:6:in `block': uninitialized
 constant B (NameError)
         from /Users/kouji/work/MacRuby/work/demo/test.rb:6:in `f'
         from /Users/kouji/work/MacRuby/work/demo/test.rb:12:in `<main>'


 $ ruby19trunk -v test.rb
 ruby 1.9.3dev (2011-03-12 trunk 31096) [x86_64-darwin10.6.0]
 10
 10
 OK
 }}}

 Thanks Kouji.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1192>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list