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 liked this post, 🗞 subscribe to my newsletter and follow me on 𝕏!