On 25/08/06, Duncan Mccaffery <d.mccaffery / lancaster.ac.uk> wrote:
> It seems activerecord is redefining the load method in some way.  I'm
> fairly new to Ruby and I'm a little stuck.  Any ideas?  I've already
> tried seperating the above into modules (active record and ruby cocoa
> stuff are in seperate name spaces (I think!) but this doesn't seem to
> work.

ActiveSupport is the culprit. In dependencies.rb, we find:

  class Object #:nodoc:
    def load(file, *extras)
      super(file, *extras)
    rescue Object => exception
      exception.blame_file! file
      raise
    end
  # ...

RubyCocoa works by responding to method_missing and despatching ObjC
messages via ocm_send; once ActiveSupport has had its evil (don't get
me started!) way, this will never happen.

You should be able to use this as a quick workaround:

  OSX::NSBundle.bundleWithPath("...snip...").ocm_send(:load)

Paul.