安装路边时发生错误(0.8.5)

时间:2013-12-04 11:35:24

标签: ruby linux bundler curb

捆绑旧项目时,出现了这个错误:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/dd/.rvm/rubies/ruby-2.0.0-p247/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
    --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=/home/dd/.rvm/rubies/ruby-2.0.0-p247/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/dd/.rvm/gems/ruby-2.0.0-p247/gems/curb-0.8.5 for inspection.
Results logged to /home/dd/.rvm/gems/ruby-2.0.0-p247/gems/curb-0.8.5/ext/gem_make.out

An error occurred while installing curb (0.8.5), and Bundler cannot continue.
Make sure that `gem install curb -v '0.8.5'` succeeds before bundling.

4 个答案:

答案 0 :(得分:38)

我找到了解决方案here

sudo apt-get install libcurl3-dev

答案 1 :(得分:10)

在CentOS上

sudo yum install libcurl-devel

答案 2 :(得分:4)

它说无法安装curb gem。转到限制主页并检查installation section

  

在Ubuntu上,可以通过安装来满足依赖关系   以下包裹:

     

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

     

On RedHat:

     

$ sudo yum install ruby​​-devel libcurl-devel openssl-devel

答案 3 :(得分:-1)

对于Ubuntu:

sudo apt-get install libcurl4-openssl-dev