1

Was trying to run bundle install for a Ruby on Rails project which required gem curb. Here's what happened:

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

current directory: /home/lance/.rvm/gems/ruby-2.6.4/gems/curb-0.9.11/ext

/usr/share/rvm/rubies/ruby-2.6.4/bin/ruby -I /usr/share/rvm/rubies/ruby-2.6.4/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210120-31208-z4fk7m.rb extconf.rb checking for curl-config... no checking for -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=/usr/share/rvm/rubies/ruby-2.6.4/bin/$(RUBY_BASE_NAME) --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.

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/home/lance/.rvm/gems/ruby-2.6.4/extensions/x86_64-linux/2.6.0/curb-0.9.11/mkmf.log

extconf failed, exit code 1

1 Answers1

2

Need to install the correct packages. The error shows the problem in curl.h so go to http://packages.ubuntu.com and search for curl.h which shows what needs to be installed:

sudo apt-get install libcurl4-gnutls-dev libcurl4-nss-dev libcurl4-openssl-dev
muru
  • 207,970
  • 1
    See https://packages.ubuntu.com/search?suite=focal&arch=amd64&mode=exactfilename&searchon=contents&keywords=curl%2Fcurl.h without guessing. – N0rbert Jan 20 '21 at 16:17