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-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.
- 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 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.
- “./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.
- “sudo make install”
Build librets ruby
- In the project/swig folder, use “make ruby”
- 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
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.