Kaoru Shirai - 2008-04-11

I installed Ruby 1.8.6p111 from MacPorts.
Then I run the command:

/opt/local/bin/ruby -r osx/cocoa -e ""

but got following error:

/opt/local/lib/ruby/site_ruby/1.8/osx/objc/oc_import.rb:29: uninitialized constant OSX::RUBYCOCOA_FRAMEWORK_PATHS (NameError)
        from /opt/local/lib/ruby/site_ruby/1.8/osx/objc/oc_all.rb:9:in `require'
        from /opt/local/lib/ruby/site_ruby/1.8/osx/objc/oc_all.rb:9

If I run same command with Apple's ruby, it success.

  /usr/bin/ruby -r osx/cocoa -e ""

I found the command:

  /opt/local/bin/ruby -r rubycocoa -r osx/cocoa -e ""

does not cause any error.

So the solution is adding
  require "rubycocoa"
before "require 'osx/objc/cocoa.rb'".

But, is there some difference between Apple's Ruby and Macport's?