Posts tagged scaling
Memcached, gems, and Macports
Jun 10th
I actually really like Macports; it’s got a lot of software, it’s well-maintained, it works really well. Kudos to the Macports guys.
We have been having a problem with ruby though, or specifically with the memcached gem for Ruby. The problem is that it won’t compile with the latest versions of libmemcached. The latest, you see is 0.30, but it won’t compile with 0.26 or higher. In fact, if you’re using version 0.14 of the memcached gem, it won’t compile with 0.24 or lower. Oh, and it won’t compile with 0.25 either.
In fact, it won’t compile at all with any version of libmemcached for most people, and if it does it rarely works.
Unfortunately, the version of libmemcached required, 0.25.14, is only available (as far as I can find) on Evan Weaver’s blog post mentioning it. For people like me who like to keep everything package-managed when possible, this is a hassle. There’s no one-line command to make everything work, set it all up, and get it going. Kind of ugly, imho.
Fortunately, the ports system is as flexible as it is powerful, and you can easily hack the ports file to know about this new, better version. For you, I have done this, and you can find it in my github repo if you so desire, though I’ll include it here for reference. Behold!
Notice the ‘variant’ section at the bottom; that’s all I had to add to add support for this edge-case to Macports. Hopefully, as a result, the Macports maintainer will be willing to add this change into the official portfile. I suppose we’ll see. In the meantime, if you want to add this functionality, you need only replace your current portfile with the one in my GitHub repo. Instructions, paths, and commands are all at that URL. Enjoy!