大家好我试图在我的Linux薄膜14上安装curl gem但是我在控制台中输出了以下错误:
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
我无法找到解决此问题的方法。提前感谢您的帮助。
编辑: 我尝试了每一个答案,但似乎我的系统中的某些软件包有问题...:
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.
答案 0 :(得分:7)
如果您使用的是linux,请安装libcurl3-dev
库:
apt-get install libcurl3-dev
答案 1 :(得分:1)
安装libcurl4-gnutls-dev
和libcurl3-dev
个软件包:
sudo apt-get install libcurl4-gnutls-dev libcurl3-dev
然后尝试再次安装curl
gem
gem install curl