# Osx/cocoa \<-\> rails incompatibility

**URL:** <https://www.ruby-forum.com/t/osx-cocoa-rails-incompatibility/169879>\
**Category:** Rails\
**Created:** [June 9, 2009, 10:15pm UTC](https://www.ruby-forum.com/t/osx-cocoa-rails-incompatibility/169879 "2009-06-09T22:15:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![djconcepcion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/57b2e6/32.png) [@djconcepcion](https://www.ruby-forum.com/u/djconcepcion)\
**Post date:** [June 9, 2009, 10:15pm UTC](https://www.ruby-forum.com/t/osx-cocoa-rails-incompatibility/169879/1 "2009-06-09T22:15:24Z")

</div>

Does anyone know how to fix or even debug the following:

ActiveRecord is failing @ base.rb, line 2189:  
Thread.current[:"#{self}\_scoped\_methods"] ||= self.default\_scoping.dup

with:  
“can’t dup NilClass”

why default\_scoping is nil is unknown.

The failure goes away if all references to  
require ‘osx/cocoa’ are removed.

\*\*\* LOCAL GEMS \*\*\*

actionmailer (2.3.2, 1.3.6)  
actionpack (2.3.2, 1.13.6)  
actionwebservice (1.2.6)  
activerecord (2.3.2, 1.15.6)  
activeresource (2.3.2)  
activesupport (2.3.2, 1.4.4)  
acts\_as\_ferret (0.4.3, 0.4.1)  
capistrano (2.5.5, 2.0.0)  
cgi\_multipart\_eof\_fix (2.5.0)  
daemons (1.0.10, 1.0.9)  
dnssd (0.7.1, 0.6.0)  
fastthread (1.0.7, 1.0.1)  
fcgi (0.8.7)  
ferret (0.11.6, 0.11.4)  
gem\_plugin (0.2.3)  
gnuplot (2.2)  
gruff (0.3.4)  
highline (1.5.1, 1.2.9)  
hpricot (0.8.1, 0.6)  
libxml-ruby (1.1.3, 0.9.5, 0.3.8.4)  
mongrel (1.1.5, 1.1.4)  
mysql (2.7)  
needle (1.3.0)  
net-scp (1.0.2)  
net-sftp (2.0.2, 1.1.0)  
net-ssh (2.0.11, 1.1.2)  
net-ssh-gateway (1.0.1)  
rails (2.3.2, 1.2.6)  
rake (0.8.6, 0.7.3)  
RedCloth (4.1.9, 3.0.4)  
rmagick (2.9.1)  
ruby-openid (2.1.6, 1.1.4)  
ruby-yadis (0.3.4)  
rubygems-update (1.3.3, 1.3.2)  
rubynode (0.1.5, 0.1.3)  
sqlite3-ruby (1.2.4, 1.2.1)  
termios (0.9.4)  
tlsmail (0.0.1)  
tmail (1.2.3.1)

ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]

thanks in advance

---

<div class="post-metadata">

**Author:** ![djconcepcion](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/57b2e6/32.png) [@djconcepcion](https://www.ruby-forum.com/u/djconcepcion)\
**Post date:** [June 10, 2009, 5:49pm UTC](https://www.ruby-forum.com/t/osx-cocoa-rails-incompatibility/169879/2 "2009-06-10T17:49:26Z")

</div>

I’ve seen this before - it’s typically a sign that something has  
screwed up the inherited callback for AR::Base. And a quick look at  
the rubycocoa source shows this:  
(in

> **[RubyCocoa](https://sourceforge.net/projects/rubycocoa/)**
>
> Download RubyCocoa for free. RubyCocoa is a Mac OS X framework that allows Cocoa programming in the object-oriented scripting language Ruby.

class ActiveRecord::Base  
class \<\< self  
alias\_method :\_\_inherited\_before\_proxy, :inherited  
def inherited(klass)  
proxy\_klass = “#{klass.to\_s}Proxy”  
unless klass.parent.local\_constants.include?(proxy\_klass)  
eval “class ::#{proxy\_klass} \< OSX::ActiveRecordProxy; end;”  
# FIXME: This leads to a TypeError originating from:  
oc\_import.rb:618:in `method\_added’  
# Object.const\_set(proxy\_klass, Class.new  
(OSX::ActiveRecordProxy))  
end  
\_\_inherited\_before\_proxy(klass)  
end  
end

There’s something going on, but I’m not clear why this would cause a  
problem. You might do better asking on a rubycocoa list…

–Matt J.
