Now that we got that out of the way...
How I finally got curb to install in Windows.
- Install the latest Ruby installer and DevKit.
The finer points of doing that are outside the scope of this post, so if you have trouble with those things I'd reccommend this tutorial, the DevKit Howto and the excellent RubyInstaller mailing list.
Just for the record, I'm using the latest as of the time I'm writing this: ruby-1.9.1-p429 and devkit-3.4.5r3-20091110.7z.
- Get libcurl.
I, again, am using the latest as of the time I'm writing this: 7.21.0. If you need a different version for whatever reason, the libcurl downloads page has a few different versions available, so make sure to get the one for mingw32 and that you get libcurl and not plain-old curl.
With that downloaded, I extracted the .zip file to the root of my C:\ drive. The location you put this is important for the next steps.
- Put the curl binaries in your path.
My preferred way is to add the libcurl \bin folder to the Windows path, so that typing 'path' at a Windows command prompt gives a result like this:
Other things you can do here are copy the libcurl .dll files into your ruby's \bin folder (or anywhere else in the PATH) but I think that's kinda lame.
- Install curb.
The magic incantation I found for this was the following:
gem install curb -- --with-curl-lib=C:\curl-7.21.0-devel-mingw32\bin --with-curl-include=C:\curl-7.21.0-devel-mingw32\include
Every other combination of flags and paths resulted in compilation errors, so you've been warned. Also, you'll need to change the curl paths if you decided to install to a different place or with a different version.
- Test it.
Here's a very simple script that will load curb and GET a url:
c = Curl::Easy.new
c.url = "http://example.com"
Did this work for you? Let me know in the comments!