small medium large xlarge

06 Mar 2011, 02:06
Braz Ford (2 posts)

I’m trying to do basic stuff from the RubyCocoa book. My code seems to work fine in terminal, but it barfs on the require ‘osx/cocoa’ line in XCode.


06 Mar 2011, 02:15
Braz Ford (2 posts)

Okay, strangely, I omitted requires, includes, and framework declarations, and now my project seems to be working with:

class Controller < NSObject

I’ll keep going and see if everything is actually connected…

07 Mar 2011, 21:27
Gregory Clarke (15 posts)

Hi Braz,

That looks like MacRuby rather than RubyCocoa. For RubyCocoa that line would be:

class Controller < OSX::NSObject

You can have newer versions of MacRuby installed at the same time as RubyCocoa, but older versions interfered with RubyCocoa code. You can check if you’ve got the framework installed, it will be in /Library/Frameworks/MacRuby.framework