From: Scott T. <ea...@ma...> - 2008-05-12 12:15:16
|
On May 12, 2008, at 3:08 AM, Allison Newman wrote: > I obviously use this require in every source file for my app, but if > I try that line in irb, or try to execute one of my files from the > command line, it doesn't work. What is the magic that is used to > correctly access the framework's cocoa.rb file? It should work from irb IF you're using the same version of Ruby and irb from the command line that say XCode uses when running applications. Try using "whereis ruby" and/or "whereis irb" from the command line to find out where the executable for that name is. On my machine it comes back as: /usr/bin/ruby But, if you do "ls -l /usr/bin/ruby" on that you'll find: /usr/bin/ruby -> ../../System/Library/Frameworks/Ruby.framework/ Versions/Current/usr/bin/ruby So ruby just maps down into the Ruby.framework for the system. Correspondingly, /usr/lib/ruby maps to /usr/lib/ruby -> ../../System/Library/Frameworks/Ruby.framework/ Versions/Current/usr/lib/ruby and "osx" is at "ls -l /usr/lib/ruby/1.8/osx" So if your command line Ruby or command line irb are pointing at a different version of ruby, chances are they can't find the osx directory. You'll have to investigate on your system to find out where ruby is. Scott |