安装curb(0.8.5)时发生错误,Bundler无法继续

时间:2014-05-05 07:45:48

标签: ruby-on-rails ruby bundler curb

我已经设置了一个rails应用程序但是当我进行捆绑安装时出现错误:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/home/kelvin/.rvm/rubies/ruby-2.1.1/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/kelvin/.rvm/rubies/ruby-2.1.1/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: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.

extconf failed, exit code 1

Gem files will remain installed in /home/kelvin/.rvm/gems/ruby-2.1.1/gems/curb-0.8.5 for inspection.
Results logged to /home/kelvin/.rvm/gems/ruby-2.1.1/extensions/x86-linux/2.1.0/curb-0.8.5/gem_make.out
An error occurred while installing curb (0.8.5), and Bundler cannot continue.

在捆绑之前确保gem install curb -v '0.8.5'成功。

所以我做了

gem install curb -v '0.8.5

但我一直收到这个错误:

ERROR:  Error installing curb:
ERROR: Failed to build gem native extension.

/home/kelvin/.rvm/rubies/ruby-2.1.1/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/kelvin/.rvm/rubies/ruby-2.1.1/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: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.

extconf failed, exit code 1

Gem files will remain installed in /home/kelvin/.rvm/gems/ruby-2.1.1/gems/curb-0.8.5 for inspection.
Results logged to /home/kelvin/.rvm/gems/ruby-2.1.1/extensions/x86-linux/2.1.0/curb-0.8.5/gem_make.out

我然后谷歌错误并得到this然后引导我this

当我在我的gem主目录(〜/ .rvm / gems / ruby​​-2.1.1)中执行 ls -ladg curb - * 时,我收到以下错误

ls: cannot access curb-*: No such file or directory

请告知如何修复gem install curb

1 个答案:

答案 0 :(得分:5)

尝试安装libcurl4-openssl-dev,然后重新安装curb(如果再次失败,请尝试使用sudo