Quick heads up for anyone wanting to use libtorrent-ruby

Posted by jon

A tale of two libraries….

To make some use of some of my machines which don’t use all of their monthly bandwidth allowances I’ve installed the torrentflux web based Bit Torrent client and I just leave it helping seed some torrents. A while back I came across a Rails equivalent (there don’t seem to be many) so this morning I figured I’d give it a try.

So, I grabbed a copy of TorrentKeeper from their svn repository and went about making sure I had all the prerequisites. One of them was libtorrent-ruby, so I grabbed a copy of that too and went about installing it. Inevitably that had various dependencies too – g++, swig and of course libtorrent – which is where the confusion came from.

It required version 0.10 which as far as I was concerned I had satisfied ok (running Debian Etch, package showed 0.10.4-1), but on running setup.rb it kept on barfing looking for various files that weren’t there.


- snip
libtorrent_wrap.cpp:1830:34: error: libtorrent/bencode.hpp: No such file or directory
libtorrent_wrap.cpp:1831:32: error: libtorrent/entry.hpp: No such file or directory
libtorrent_wrap.cpp:1856:32: error: libtorrent/alert.hpp: No such file or directory
libtorrent_wrap.cpp:1857:38: error: libtorrent/alert_types.hpp: No such file or directory
libtorrent_wrap.cpp:1922:37: error: boost/filesystem/path.hpp: No such file or directory
libtorrent_wrap.cpp:1932:36: error: libtorrent/ip_filter.hpp: No such file or directory
libtorrent_wrap.cpp:1951:34: error: libtorrent/peer_id.hpp: No such file or directory
libtorrent_wrap.cpp:2027:36: error: libtorrent/peer_info.hpp: No such file or directory
libtorrent_wrap.cpp:2047:39: error: libtorrent/peer_request.hpp: No such file or directory
libtorrent_wrap.cpp:2050:38: error: libtorrent/fingerprint.hpp: No such file or directory
libtorrent_wrap.cpp:2097:39: error: libtorrent/torrent_info.hpp: No such file or directory
libtorrent_wrap.cpp:2125:33: error: libtorrent/hasher.hpp: No such file or directory
libtorrent_wrap.cpp:2128:34: error: libtorrent/storage.hpp: No such file or directory
libtorrent_wrap.cpp:2131:41: error: libtorrent/torrent_handle.hpp: No such file or directory
libtorrent_wrap.cpp:2226:43: error: libtorrent/session_settings.hpp: No such file or directory
libtorrent_wrap.cpp:2229:34: error: libtorrent/session.hpp: No such file or directory
- big snip

After a whole load of head scratching, a bit of Googling and a whole load of `find`ing I eventually twigged.

Turns out that there are two libtorrent projects around – Rakshasa and Rasterbar. Rakshasa is the one you’ll find packaged for Debian however the Rasterbar version is the one libtorrent-ruby is written for.

So, if you come across this while having problems trying to do anything that requires libtorrent and can’t work out why it’s saying it’s missing when you think it’s definitely there, make sure you’ve got the right version.

Comments

Leave a response