I’ve used librets with Ruby on WinXP for a while now, but now I need it on my new Mac to try out some new ideas with RETS. Clearly, I’m a Mac “noob”, but boy – was this freakin’ hard! I’ve documented it here for future reference. Hopefully it will help someone else out.
Download librets
- Download librets-1.1.9.tar.gz from CRT.
- According to /doc/build/mac-osx.txt and unix.txt, it looks like there’s a lot of dependencies to install and build, which I’m not too comfortable doing manually.
- There’s a note that that the OpenDarwin package manager can install these for you, and I remembered reading about MacPorts earlier, so that seems worth installing.
Install MacPorts
- Download and install MacPorts from http://www.macports.org/
- Make sure path is correct according to installation instructions.
- Update MacPorts using “sudo port selfupdate”.
Install dependencies
- Install Boost using “sudo port install boost”. Takes a while – about 15 minutes for me.
- Install Expat using “sudo port install expat”
- Install ANTLR using “sudo port install antlr”
- Install libcurl using “sudo port install curl”
- Install swig using “sudo port install swig”. This was not documented as a dependency, so it took a while to figure this one out after the below steps kept failing.
Build librets
- “./configure” kept returning errors finding Expat and Boost files.
- Used “./configure –with-expat-prefix=/opt/local –with-boost-prefix=/opt/local –enable-shared_dependencies” instead.
- “make”
- “sudo make install”
Build librets ruby
- In the project/swig folder, use “make ruby”
Test
- In the project/swig/ruby folder, run “ruby login.rb” and “ruby search.rb”
You’ll know now if you’ve got everything dialed in. Note that when you are writing your own Ruby code in a different folder, make sure you include the path to librets.rb at the top like this:
# Prepend load path with path to librets.rb
$:.unshift(‘/usr/local/src/librets-1.1.9/project/swig/ruby’)
require ‘librets’
include Librets
Geez! That took a while. I guess if I’d had a lot of *nix experience, it would have been easier, but librets has a special Windows install that easier.
Special thanks to the CRT guys for making librets freely available.

I waited for the new 24-inch iMac’s to come out and snagged one the first week. The display is unreal, the desktop is beautiful, and everything just works. I can run WinXP in a window faster than on my old computer, and I can even drop down into Terminal for a bash shell. There’s a reason I’m seeing more and more Mac notebooks at every conference I go to.




