« OpenGL is turtles all the way down | Main | Quick ports with RubyCocoa »
February 18, 2005
RubyCocoa progress
I got the latest CVS version of RubyCocoa working well with Ruby 1.8.2 on my mac last night. There had been a few problems using the standard tarball, and I was encountering interesting doubly-defined symbol errors since RubyCocoa was statically linking in libruby, as was the ruby interpreter itself. I fixed the linking errors and ran across a new one related to NSApplication, so I did some googling and found people had better luck with the CVS version. It worked the first time I tried it, it was great to get the HelloWorld app up and running.
When RubyCocoa installs itself, it installs the RubyCocoa framework into the standard frameworks location on your host. The framework is linked to the version of ruby that was used to setup RubyCocoa, so you don't have to set environment variables, or play with executables, it just works. An added benefit is that you can then create honest-to-god OS X .app files that link against RubyCocoa's frameworks, and make clickable applications. Distribution of the application is a little dicey, since while ruby's interpreter is linked into RubyCocoa, the ruby files and extensions that implement non-core libraries are not.
I did some searching and found out that there has been some progress made on being able to bundle RubyCocoa apps that are entirely self-contained (which would be great, because then you don't have to ask users to download anything, they just download your .app file and start using it, never knowing that the core logic is in Ruby versus Obj-C or Java). It sounds like they are 80% there, but nobody has posted how to link in the libs/extensions properly. I'm going to take a shot at that tonight, I'm betting some TLC with ktrace will point the way.
I started writing up the slides for my talk, and will be writing a couple small apps this weekend for practice. I'd like to figure out the self-contained Ruby app problem before the talk, but if it doesn't work out, you can still run apps okay on a developer's host, it just makes redistribution difficult for users who want to try out the software.
I'll post screenshots and some sample code later this weekend to give you a taste of what working with RubyCocoa is like, and will also post the slides the day of my talk.
Posted by djb at February 18, 2005 03:02 PM