#95: uninitialized constant NSHomeDirectory ------------------------------------+--------------------------------------- Reporter: jonathan@waddilove.net | Owner: lsansonetti@apple.com Type: defect | Status: closed Priority: minor | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ------------------------------------+--------------------------------------- Changes (by lsansonetti@apple.com): * status: new => closed * resolution: => invalid Comment: Do not forget to load the Cocoa framework first (loading only Foundation should work too), then since NSHomeDirectory is actually a C function, and that it starts with a capital letter, Ruby needs you to specify the parentheses otherwise it will think it's a constant. {{{ $ macirb
NSHomeDirectory NameError: uninitialized constant NSHomeDirectory from (irb):1 from /usr/local/bin/macirb:12:in `<main>' framework 'Cocoa' => true NSHomeDirectory NameError: uninitialized constant NSHomeDirectory from (irb):3 from /usr/local/bin/macirb:12:in `<main>' NSHomeDirectory() => "/Users/lrz"
}}}
-- Ticket URL: <https://www.macruby.org/trac/ticket/95#comment:1> macruby <http://macruby.org/>