Thursday, October 28, 2021

[SOLVED] Can't install curl gem

Issue

Hi everyone I'm trying to install curl gem on my Linux mint 14 but I have the following error output in the console:

Building native extensions.  This could take a while...
ERROR:  Error installing curb:
    ERROR: Failed to build gem native extension.

    /home/mateusz/.rvm/rubies/ruby-2.0.0-p0/bin/ruby 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
    --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=/home/mateusz/.rvm/rubies/ruby-2.0.0-p0/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}/
    --with-curllib
    --without-curllib
extconf.rb:18: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 /home/mateusz/.rvm/gems/ruby-2.0.0-p0@rails4/gems/curb-0.8.6 for inspection.
Results logged to /home/mateusz/.rvm/gems/ruby-2.0.0-p0@rails4/gems/curb-0.8.6/ext/gem_make.out

I can't find solution for this problem. Thanks in advance for any help.

EDIT: I tried every answer but seems that I have problem with some packages in my system... :

Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutls26_2.12.14-5ubuntu4.6_i386.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutls26_2.12.14-5ubuntu4.6_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/c/curl/libcurl3-gnutls_7.27.0-1ubuntu1.9_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/c/cups/cups-bsd_1.6.1-0ubuntu11.6_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/c/cups/cups-client_1.6.1-0ubuntu11.6_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.6.1-0ubuntu11.6_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.6.1-0ubuntu11.6_i386.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/c/cups/cups_1.6.1-0ubuntu11.6_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutls-openssl27_2.12.14-5ubuntu4.6_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutlsxx27_2.12.14-5ubuntu4.6_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://archive.ubuntu.com/ubuntu/pool/main/libg/libgpg-error/libgpg-error-dev_1.10-3.1ubuntu1_amd64.deb  404  Not Found [IP: 91.189.88.149 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/libg/libgcrypt11/libgcrypt11-dev_1.5.0-3ubuntu1.1_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://archive.ubuntu.com/ubuntu/pool/main/libt/libtasn1-3/libtasn1-3-dev_2.13-2_amd64.deb  404  Not Found [IP: 91.189.88.149 80]
Nie udało się pobrać http://archive.ubuntu.com/ubuntu/pool/main/p/p11-kit/libp11-kit-dev_0.13-1_amd64.deb  404  Not Found [IP: 91.189.88.149 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutls-dev_2.12.14-5ubuntu4.6_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się pobrać http://archive.ubuntu.com/ubuntu/pool/main/libi/libidn/libidn11-dev_1.25-2_amd64.deb  404  Not Found [IP: 91.189.88.149 80]
Nie udało się pobrać http://archive.ubuntu.com/ubuntu/pool/main/o/openldap/libldap2-dev_2.4.31-1ubuntu2_amd64.deb  404  Not Found [IP: 91.189.88.149 80]
Nie udało się pobrać http://archive.ubuntu.com/ubuntu/pool/main/r/rtmpdump/librtmp-dev_2.4+20111222.git4e06e21-1_amd64.deb  404  Not Found [IP: 91.189.88.149 80]
Nie udało się pobrać http://security.ubuntu.com/ubuntu/pool/main/c/curl/libcurl4-gnutls-dev_7.27.0-1ubuntu1.9_amd64.deb  404  Not Found [IP: 91.189.91.13 80]
Nie udało się poprawić brakujących pakietów.

Solution

If you're on linux, install libcurl3-dev library:

apt-get install libcurl3-dev


Answered By - Marek Lipka