3. Getting RubyCocoa

The home for RubyCocoa development is hosted at sourceforge.net.
Look there for the latest news and releases.

RubyCocoa distributions are downloadable from this page on SourceForge.

The current version is 0.13 (released November 24, 2007). It’s a universal binary that works great on Intel iMacs and Mac Books. If you’re using the Apple-installed ruby (the one at /usr/bin/ruby), then you probably want to download and install the disk image—it’s the file whose name ends in ”.dmg”. After downloading it, double click on it and the installation will begin.

If you have built a newer version of ruby and installed it somewhere else (probably /usr/local/bin/ruby), then you’ll need to instead download the source code distribution and build RubyCocoa yourself. To do so, download the file ending in ”.tgz”. To build, simply run the following in the unpacked directory:
ruby install.rb config
ruby install.rb setup
sudo ruby install.rb install

To keep up with the latest developments and bug fixes, you can download and build RubyCocoa directly from the subversion repository. The latest versions of RubyCocoa can be checked out with the following subversion command:

svn co https://rubycocoa.svn.sourceforge.net/svnroot/rubycocoa/trunk rubycocoa
Recently (Fall 2006), there have been a lot of bleeding-edge changes on a branch that you can check out with this:
svn co https://rubycocoa.svn.sourceforge.net/svnroot/rubycocoa/branches/apple-unstable rubycocoa
If you get an error message like the following, you probably are running with an old version of subversion:
% svn co https://rubycocoa.svn.sourceforge.net/svnroot/rubycocoa/trunk rubycocoa
svn: SSL is not supported

Download and install a new subversion client from Matthew Porter’s archive on metissian.com. Be sure to use version 1.3.1 or later to get a universal binary and SSL support.

The RubyCocoa development team has switched from CVS to Subversion. The CVS archive has been abandoned for new development.

To get RubyCocoa sources from CVS, first log into the sourceforge CVS server with the following command:
cvs -d:pserver:anonymous@rubycocoa.cvs.sourceforge.net:/cvsroot/rubycocoa login

If you are prompted for a password, just press return. Then use the following command to download the sources to a “rubycocoa” directory in your current working directory:

cvs -z3 -d:pserver:anonymous@rubycocoa.cvs.sourceforge.net:/cvsroot/rubycocoa co -P rubycocoa

If the above steps fail, check the RubyCocoa CVS information page.

After checking out the sources, you can build RubyCocoa using the steps in the previous section.

Did you find an error? Is something missing? Post your comment or suggestion below!

Comments (17) post
  1. tfw Sun Aug 06 13:38:28 +0000 2006

    MAKE SURE you install the latest (at least .4.3, as of this writing). The .4.2 binary had bugs on Tiger. Do not be mislead by the “news” on the front page, none of those releases have working binaries for Tiger. Stick with the version mentioned on this page.

  2. Tim Burks Fri Oct 27 21:30:00 +0000 2006

    It’s really best to build directly from the Subversion archives. A lot has changed since the last release, and until the next one (which appears to be coming soon), you’ll want all the improvements that Laurent and others have made.

  3. Ian Thu Nov 09 12:04:54 +0000 2006

    Nice tutorial, thank you!

    I took your advice and checked out the latest sources from the SVN repository. However, the “ruby install.rb setup” step fails. Unfortunately, I did the “sudo ruby install.rb install” step before noticing. Anyways, it would be helpful if there was a pointer to an uninstall or upgrade guide. If I get through it in one piece, I’ll send it to you.

    Thanks again!

  4. Nick Kallen Sun Jan 07 21:01:42 +0000 2007

    I also can’t install from the svn repository. I get an error during install.rb setup:

    Ld /Users/nkallen/Desktop/rubycocoa-0.5.0.1/rubycocoa/src/framework/build/Default/RubyCocoa.framework/Versions/A/RubyCocoa normal i386 cd /Users/nkallen/Desktop/rubycocoa-0.5.0.1/rubycocoa/src/framework /usr/bin/gcc-4.0 -o /Users/nkallen/Desktop/rubycocoa-0.5.0.1/rubycocoa/src/framework/build/Default/RubyCocoa.framework/Versions/A/RubyCocoa -L/Users/nkallen/Desktop/rubycocoa-0.5.0.1/rubycocoa/src/framework/build/Default -L/usr/local/lib -F/Users/nkallen/Desktop/rubycocoa-0.5.0.1/rubycocoa/src/framework/build/Default -filelist /Users/nkallen/Desktop/rubycocoa-0.5.0.1/rubycocoa/src/framework/build/RubyCocoa.build/Default/RubyCocoa.build/Objects-normal/i386/RubyCocoa.LinkFileList -framework Cocoa -framework QTKit -arch i386 -compatibility_version 1 -current_version 1 -install_name @executable_path/../Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa -Wl,-Y,1455 -dynamiclib -mmacosx-version-min=10.3 -flat_namespace -lxml2 /usr/local/lib/libruby-static.a ld: Undefined symbols: _environ /usr/local/lib/libruby-static.a(ruby.o) reference to undefined _environ /usr/bin/libtool: internal link edit command failed
    • BUILD FAILED ** setup failed ‘system /usr/bin/xcodebuild’ failed
  5. Laurent Sansonetti Tue Jan 09 02:36:18 +0000 2007

    Hi Nick,

    It seems that you are installing 0.5.0.1. What’s your version of Ruby?

  6. joachimm Fri Jan 12 22:25:57 +0000 2007

    I get the following error, I built ruby 1.8.4 using the hivelogic instructions. Rubycocoa checkedout from subversion (revision 1414)

    %ruby install.rb config

    install.rb: entering config phase… config failed

    hook /Users/joachimm/rubycocoa-unstable/./pre-config.rb failed:

    ERROR: ruby must be built as a shared library

    try ‘ruby install.rb—help’ for usage

  7. Josh Kieschnick Mon Jan 15 22:11:15 +0000 2007

    I’m getting the same error messages as Nick. I check the src out from subversion and I’m running ruby 1.8.4

  8. joachimm Wed Jan 17 06:56:53 +0000 2007

    solved my problem by recompiling ruby as—enable-shared

  9. Stephen Ng Wed Jan 17 21:36:34 +0000 2007

    Nick,

    Did you solve your install problem? I got the same Undefined symbol: _environ error when executing setup with the svn version.

    Anyone else found a fix? I have not tried v 0.5. Should I use this instead?

    Regards.

  10. lambchop Thu Feb 01 09:37:53 +0000 2007

    If you’ve grabbed ruby from darwinports you can also get rubycocoa from there.

    sudo port install rb-cocoa

  11. Arun Sun Feb 04 22:02:15 +0000 2007

    Nick, Stephen

    Upgrading to ruby 1.8.5 fixed the problem for me.

  12. Exabrial Mon Feb 05 22:43:05 +0000 2007

    On OSX:

    I complied ruby 1.8.5 (2006-12-25 patchlevel 12) [powerpc-darwin8.8.0] with these flags:

    ./configure—prefix=/usr/local—enable-pthread—with-readline-dir=/usr/local—enable-shared

    And then rubycocoa 0.10.1 with:

    ruby install.rb config—prefix=/usr/local/

    to get everything to work… :)

  13. Ferhat Ayaz Tue Sep 04 14:03:52 +0000 2007

    Great! Thank you

    The svn url is now slight different. It worked for me with the following rep:

    svn co https://svn.sourceforge.net/svnroot/rubycocoa/trunk rubycocoa

  14. Vinicius Manhaes Teles Fri Sep 07 20:09:20 +0000 2007

    Actually, the correct svn url seems to be:

    svn co https://rubycocoa.svn.sourceforge.net/svnroot/rubycocoa rubycocoa .

  15. Vinicius Manhaes Teles Fri Sep 07 20:27:15 +0000 2007

    Sorry, forgot to add trunk at the end of the URL:

    svn co https://rubycocoa.svn.sourceforge.net/svnroot/rubycocoa/trunk rubycocoa

  16. Diego Kuperman Wed Dec 19 02:13:42 +0000 2007

    There is another (and easy) way to install it: using the macports ;)

    port install rb-cocoa

    I’m really enjoing your tutorial, thanks!

  17. John Chandler Tue Feb 05 05:24:30 +0000 2008

    Did I fail to follow an instruction, or is there a problem with the build script? Per the instructions on page 4, ...

    irb(main):001:0> require ‘osx/cocoa’ LoadError: Failed to load /usr/local/lib/ruby/site_ruby/1.8/universal-darwin8.0/rubycocoa.bundle

    H’mm, now why would that be?

    Quetzalcoatl:/usr/local/lib/ruby/site_ruby/1.8/universal-darwin8.0 # file rubycocoa.bundle rubycocoa.bundle: Mach-O bundle i386 Quetzalcoatl:/usr/local/lib/ruby/site_ruby/1.8/universal-darwin8.0 #

    OK, well, clearly i386 != universal. I’m on a PowerBook. How do I fix this? Other than replacing my machine, I mean.