Ruby SVN Bindings on OSX

Posted by Tejus Parikh on March 17, 2008

Most of the information about this is outdated and not very useful. Collaboa’s site suggests that you need to build the bindings from source. If you attempt this and use Macports for dependencies, you’ll get un-resolvable errors regarding time.h. Installing subversion-rubybindings from Macports itself doesn’t work either. This approached failed since it was unable to find the dependency db44. Thankfully, there is a solution if you want to do this. First install Ruby and whatever from Macports. Then grab the OSX one-click installer. Once that’s installed, you need to make Ruby aware of the bindings. Do this by copying the bindings files into your Ruby:


$ sudo cp -r /opt/subversion/lib/svn-ruby/universal-darwin8.0/svn /opt/local/lib/ruby/site_ruby/1.8/i686-darwin9.1.0

$ sudo cp -r /opt/subversion/lib/svn-ruby/svn /opt/local/lib/ruby/site_ruby/1.8

Do not use symbolic links. I tried this at first and it didn’t work. You can then test to make sure it works with:

irb

>> require 'svn/core'

=> true

>> 

Related Posts:

Tejus Parikh

Tejus is an software developer, now working at large companies. Find out when I write new posts on twitter, via RSS or subscribe to the newsletter: