1
C:\sites\loltilt2>gem install curb -v '0.8.5'
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing curb:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb
checking for curl-config... no
checking for main() in -lcurl... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby193/bin/ruby
        --with-curl-dir
        --without-curl-dir
        --with-curl-include
        --without-curl-include=${curl-dir}/include
        --with-curl-lib
        --without-curl-lib=${curl-dir}/lib
        --with-curllib
        --without-curllib
extconf.rb:23:in `<main>':   Can't find libcurl or curl/curl.h (RuntimeError)

  Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
  options to extconf.


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/curb-0.8.
5 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/curb-0.8.5/ext/gem_make.ou
t

how do i fix this curb issue? I've been trying for hours, but the gem won't install. i have tried installing a different version of curb... still doesn't install. I have also tried placing the 2 .dll files into my windows folder... still doesn't install. What should I do?

  • 1
    You need the libCURL library I believe - you should check out this tutorial: http://jes.al/2012/10/installing-curb-gem-on-windows-7/ – Richard Peck Aug 12 '14 at 07:39

2 Answers2

3

Windows

Installing a gem which doesn't have "native extensions" is more about the gem & its dependencies, and less about Windows.

You mention you've "put the .dll files in the Windows folder" - this won't solve the problem, as it still doesn't give the gem that which it needs -- library / "header" files. Like the mysql2 or imagemagick gems, you need to have a version of the "software" installed on your system, which the gem will then be able to reference upon installation

Although I have installed the curb gem on Windows 7 before, a recent system upgrade removed it (thus leaving me without any first-hand references for you). However, I can tell you it is possible if you use a tutorial like this

--

libCURL

The bottom line is you need to install & reference the libCURL library on your PC before attempting to install the gem. This is the trickiest part - you need to find the version of libCURL which has all the correct files, etc for you

You need the MingW32 Binary version of libCURL (curl-7.xx.0-devel-mingw32)

When you download & unzip the binary file, you should have the /include and /bin directories with the library (that's how you know if you have the right version):

enter image description here

Once you have this, unzip it to a folder on your system:

enter image description here

--

Gem

This will give you the ability to reference the library files it contains when installing your gem:

gem install curb --version 0.7.18 --platform=ruby -- -- --with-curl-lib="C:/path/to/your/curl-7.xx.0-devel-mingw32/bin" --with-curl-include="C:/path/to/your/curl-7.xx.0-devel-mingw32/include"
Richard Peck
  • 76,116
  • 9
  • 93
  • 147
  • 2
    Yes so to add to this, there is a bit more complexity, or at least in my case. I had to download the package that included the curl.h file inside of include folder: https://curl.haxx.se/download.html (Last one under win32 generic) which was a separate download from the actual dll that my install required which I found here: https://curl.haxx.se/dlwiz/?type=lib&os=Win32 And then replaced the dll found in curl/bin named libcurl.dll with the one that Cygwin provided (renamed to libcurl.dll) – ajameswolf Oct 31 '16 at 06:34
  • Thank you for the update. If only Windows had a central repo for libraries! – Richard Peck Oct 31 '16 at 07:41
0

As Rich said in the comments, libcurl is required for curb. You can download it here as a zip file, then extract it wherever you want. If you have trouble, read the documentation.

dax
  • 10,779
  • 8
  • 51
  • 86