Protocol https not supported or disabled in libcurl

This is the second time I had to figure this out, so I’m documenting it for prosperity. It’s certainly nothing special, but I’m sure that others have wasted time searching for the solution as well. Assuming you’re using Macports, read on.

I’ve been automating a bunch of stuff with various rake tasks in a Rails project. One task in particular, has a line similar to the following:

curl --user bob@foo.com:password https://foo.com/db.sql > db.sql

Which, when run, yields the following error:

curl: (1) Protocol https not supported or disabled in libcurl

To fix it, do the following:

sudo port deactivate curl
sudo port install curl +ssl

And voila.

“git grep”, another grep alternative

So as I was recently saying, ack is a fine grep alternative for programming tasks, but I should also mention another useful tool: git grep. It’s extremely simple, it just searches through all your checked-in files for the given expression. The advantages are that it’s extremely fast due to git’s efficient disk layout, and it’s reasonably common to want to know where a given string has been checked in (especially if you have a lot of generated source code). The drawbacks are that its command line options are a bit limited, it’s missing all of ack’s nice features, and of course it only works on git repositories. Still, a handy little tool to have at hand.