58

I am trying to install curb 0.8.0 on a Windows computer but I can not seem to get anywhere. I have been trying every website 3 pages deep on my Google search. Please, anyone have an idea of how I can get this single thing installed. I have downloaded curl and extracted it to C:\curl. I have added it to my path and am running the command:

gem install curb -- --with-curl-lib=C:\curl\bin --with-curl-include=C:\curl\include

But it doesn't work. I keep getting the same error. Any suggestions?

MrMortales
  • 647
  • 1
  • 7
  • 7

8 Answers8

128

If you are on ubuntu:

sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
Niels Kristian
  • 8,661
  • 11
  • 59
  • 117
  • 4
    I was getting the error for feedzirra gem and this fixed my issue. Thanks. – blockloop Mar 30 '13 at 18:53
  • 17
    only the last library seems necessary: `sudo apt-get install libcurl4-openssl-dev` – Pierre Michard May 13 '15 at 17:22
  • The current command in the answer generates an error (at least in Ubuntu 18.04) @PierreMichard 's [comment](https://stackoverflow.com/questions/10184615/cant-find-libcurl-or-curl-curl-h-runtimeerror#comment48546710_14160148) works perfectly and should replace the current content of this answer – icc97 Jul 29 '19 at 12:40
29

If you are on ubuntu 18.04/20.04.2 LTS:

sudo apt-get install libcurl4 libcurl4-openssl-dev
Rabi
  • 536
  • 5
  • 5
  • This has already been suggested in this thread. Please only post answers that add new aspects not repeat previously posted approaches. – Mr. T Nov 12 '18 at 12:55
  • 3
    This has not been suggested, and was useful for me. Delete your comment. – Jesse Farmer Apr 02 '19 at 01:01
  • 4
    This has not been suggested and was useful for me. The other solutions didn't work on Ubuntu 18.04. – Hariharan L May 22 '19 at 15:53
  • 2
    Agreed with Jesse and Hariharan -> this is useful and has not been recommended yet. If you're running 18.04 this works! – Timmy Aug 09 '19 at 17:35
  • 1
    On Ubuntu 20.04 LTS same thing: sudo apt-get install libcurl4 libcurl4-openssl-dev – Rabi Oct 08 '20 at 08:04
10

The curb gem requires libcurl, something that is related to, but different from curl. It's the library that curl is built with. That missing file is part of the development version of cURL.

tadman
  • 208,517
  • 23
  • 234
  • 262
  • I installed curl-7.25.0-devel-mingw32.zip but by adding changing my command to gem install curb -- --with-curl-lib="C:/curl/bin" --with-curl-include="C:/curl/include" but when I try to run bundle install or rails -s I get the error again. – MrMortales Apr 17 '12 at 12:09
8

For Amazon Linux (perhaps also centos/redhat/fedora) do this:

sudo yum install libcurl libcurl-devel
Dan Herman
  • 1,395
  • 1
  • 15
  • 26
7

If you are on alpine:

apk add --update curl-dev
Bugs
  • 4,491
  • 9
  • 32
  • 41
Omer Levi Hevroni
  • 1,935
  • 1
  • 15
  • 33
5

type this to get rid of curl/curl.h error

sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev

after this you will get a freeTDS error if you haven't installed it previously

Try running

sudo apt-get install freetds-dev

and after this

gem install tiny_tds
Anshul Kalra
  • 198
  • 3
  • 13
4

First, update your package lists by running

sudo apt-get update

then install the development version of libcurl3

sudo apt-get install libcurl3-dev
Korayem
  • 12,108
  • 5
  • 69
  • 56
3

Such header files are usually packaged in a xxx-dev package. In this case libcurl-dev.

Usually they also provide "virtual" packages that resolve to latest version of a package. In case there are multiple implementation available then it'll list and ask you to pick the one you want, else it'll go ahead and select the latest one.

vagrant@my_box $ sudo apt-get install libcurl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libcurl-dev is a virtual package provided by:
  libcurl4-openssl-dev 7.22.0-3ubuntu4.17
  libcurl4-nss-dev 7.22.0-3ubuntu4.17
  libcurl4-gnutls-dev 7.22.0-3ubuntu4.17
You should explicitly select one to install.

E: Package 'libcurl-dev' has no installation candidate
vagrant@my_box $ # I pick gnu implementation version 4.
vagrant@my_box $ sudo apt-get install libcurl4-gnutls-dev
...
vagrant@my_box $ 

See all versions:

$ aptitude versions libcurl
Package libcurl-ocaml:
p   0.5.3-2build3                      precise        500

Package libcurl-ocaml-dev:
p   0.5.3-2build3                      precise        500

Package libcurl-ocaml-dev:i386:
p   0.5.3-2build3                      precise        500

Package libcurl-ocaml:i386:
p   0.5.3-2build3                      precise        500

Package libcurl3:
p   7.22.0-3ubuntu4                    precise        500
i   7.22.0-3ubuntu4.15                                100
p   7.22.0-3ubuntu4.17                 precise-securi 500

......

Package libcurl3-gnutls:i386:
p   7.22.0-3ubuntu4                    precise        500
p   7.22.0-3ubuntu4.17                 precise-securi 500

......

Package libcurl4-gnutls-dev:
p   7.22.0-3ubuntu4                    precise        500
i   7.22.0-3ubuntu4.17                 precise-securi 500

Package libcurl4-gnutls-dev:i386:
p   7.22.0-3ubuntu4                    precise        500
p   7.22.0-3ubuntu4.17                 precise-securi 500
......

$ # see only curl4 related stuff
$ aptitude versions libcurl4
Package libcurl4-gnutls-dev:
p   7.22.0-3ubuntu4                    precise        500
i   7.22.0-3ubuntu4.17                 precise-securi 500

Package libcurl4-gnutls-dev:i386:
p   7.22.0-3ubuntu4                    precise        500
p   7.22.0-3ubuntu4.17                 precise-securi 500

Package libcurl4-nss-dev:
p   7.22.0-3ubuntu4                    precise        500
p   7.22.0-3ubuntu4.17                 precise-securi 500

Package libcurl4-nss-dev:i386:
p   7.22.0-3ubuntu4                    precise        500
p   7.22.0-3ubuntu4.17                 precise-securi 500

Package libcurl4-openssl-dev:
p   7.22.0-3ubuntu4                    precise        500
p   7.22.0-3ubuntu4.17                 precise-securi 500

Package libcurl4-openssl-dev:i386:
p   7.22.0-3ubuntu4                    precise        500
p   7.22.0-3ubuntu4.17                 precise-securi 500
$
$

If you don't name of dev lib you can do a blind search like (greps for virtual packages):

$ aptitude search curl | grep dev | grep ^v
v   libcurl-dev                     -
v   libcurl-dev:i386                -
v   libcurl-ocaml-dev-g55y9         -
v   libcurl-ocaml-dev-owsj4:i386    -
v   libcurl-ssl-dev                 -
v   libcurl-ssl-dev:i386            -
v   libcurl3-dev                    -
v   libcurl3-dev:i386               -
v   libcurl3-gnutls-dev             -
v   libcurl3-gnutls-dev:i386        -
v   libcurl3-nss-dev                -
v   libcurl3-nss-dev:i386           -
v   libcurl3-openssl-dev            -
v   libcurl3-openssl-dev:i386       -
v   libcurl4-dev                    -
v   libcurl4-dev:i386               -
v   libghc-curl-dev-1.3.7-134ce:i38 -
v   libghc-curl-dev-1.3.7-26a38     -
v   libghc-download-curl-dev-0.1.3. -
v   libghc-download-curl-dev-0.1.3. -
v   libghc-hxt-curl-dev-9.1.1-66e48 -
v   libghc-hxt-curl-dev-9.1.1-66e48 -
$
Kashyap
  • 15,354
  • 13
  • 64
  • 103