Installing curb gem on Windows 7

You are reading this probably because you might have encountered an error like this on Windows:

Installing curb (0.7.18) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

Here’s how to fix it (Note: This is assuming you have successfully installed RailsInstaller or similar.)

1) Download libcurl (under the “Win32 - Generic” section) and extract the contents to C:\ At the time of writing 7.27.0 was the latest. If you download a different version, don’t forget to the update the paths below.

2) Add C:\curl-7.27.0-devel-mingw32\bin to your Windows path

3) Run:

gem install curb --version 0.7.18 --platform=ruby -- -- --with-curl-lib="C:/curl-7.27.0-devel-mingw32/bin" --with-curl-include="C:/curl-7.27.0-devel-mingw32/include"

By the way, those multiple dashes are not a mistake! That’s the only way I could get it to work. You can change the version to meet your needs. I had another gem which was specifically dependent on version 0.7.18 so I choose that in particular.

If you have any questions or comments, please post them below. If you liked this post, you can share it with your followers or follow me on Twitter!