|
From: Jin C. <jin...@ma...> - 2003-11-12 13:46:37
|
I've managed to get RubyCocoa built and running on Panther against ruby
1.8.0. I haven't tried redoing this with the default ruby that comes
with Panther, but these experiences may help others to figure that out.
There were several issues; I will just detail them in the form of a
recipe for what I did to get it all working.
1. Install ruby-1.8. I used fink. If you install from source, make sure
you build the shared library (configure --enable-shared).
2. Get the RubyCocoa source tree from CVS (I used the CVS version;
other sources from packaged distributions may work but I have not
tried).
3. There are several Cocoa constants defined in the ruby wrappers that
are now obsolete on Panther. You must rebuild them:
cd framework/src/objc/cocoa
rm rb_*.m
ruby gen_cocoa_wrapper.rb
4. Run "ruby install.rb config"
5. Open the framework project file (framework/RubyCocoa.pbproj) using
Xcode; we'll have to make two changes:
Problem: The error "objc: failed objc_getClass(NSObject) for
NSServicesPasteboard->isa->isa" when attempting to load the rubycocoa
bundle.
Resolution: I have yet to figure out what NSServicesPasteboard is
(completely undocumented); there are symbols for it in the AppKit
framework, but strangely, it is linking against the Foundation
framework that causes this error to go away. So: in the project, go
down to RubyCocoa->External Frameworks and check the button beside
Foundation.framework.
Problem: The error "/sw/lib/ruby/site_ruby/1.8/osx/cocoa.rb:12:in
`require': No such file to load -- osx/objc/cocoa (LoadError)" when
attempting to require 'osx/cocoa'.
Resolution: This comes about because the code in the bundle to patch
the ruby load path doesn't access the same global variable rb_load_path
when linked against the ruby static library as the one in the ruby
image. Simply unselect libruby-static.a from the file list.
That's it. Hit build while you're in xcode. If you want to do it from
the command line, modify install.rb to use xcodebuild rather than
pbxbuild and run "ruby install.rb setup". Then "ruby install.rb
install" as usual.
Hope this helps somebody.
-Jin
|