Skip to content

Instantly share code, notes, and snippets.

@IanVaughan
Created November 21, 2015 14:46
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IanVaughan/5a23f15b7f72977e3a9b to your computer and use it in GitHub Desktop.
Save IanVaughan/5a23f15b7f72977e3a9b to your computer and use it in GitHub Desktop.
patron gem fail
Installing patron 0.4.20 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/ubuntu/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20151121-13137-yck58r.rb 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/ubuntu/.rbenv/versions/2.2.3/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:34: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/ubuntu/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/patron-0.4.20 for inspection.
Results logged to /home/ubuntu/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/patron-0.4.20/gem_make.out
An error occurred while installing patron (0.4.20), and Bundler cannot continue.
Make sure that `gem install patron -v '0.4.20'` succeeds before bundling.
@gabbio
Copy link

gabbio commented Jan 27, 2017

sudo apt-get install libcurl3-dev
This should fix it

@cavpollo
Copy link

@bakeris Thanks! Got this issue and fixed it for me as well.

@mrentz
Copy link

mrentz commented Mar 24, 2018

@IanVaughan
@bakeris
Yikes!
Thank you soooooo much for this article. Whew! I was going insane.

So how on earth is anybody supposed to figure that out? when their patron gem install fails?

Could you explain how you knew this library was the culprit? So I might be able to live one more day in the event that I am unable to stumble upon the appropriate Google result?

Cheers again

@AndersonLira
Copy link

@bakeris you safe me

@kolosek
Copy link

kolosek commented Sep 25, 2018

This didn't fix my issue. But following lines did:

sudo apt remove -y libcurl4
sudo apt install -y libcurl4 curl libcurl4-openssl-dev

@jshorty
Copy link

jshorty commented Jun 24, 2019

Fix that worked for me with Homebrew + macOS

brew reinstall openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
bundle

@Nakilon
Copy link

Nakilon commented Mar 1, 2021

I wonder what should I install on Alpine Linux.

UPD: apk add ruby-dev curl-dev build-base

@Janoyan
Copy link

Janoyan commented Jun 11, 2021

sudo apt-get install libcurl3-dev
This should fix it

Thanks 👍

@okliv
Copy link

okliv commented Aug 2, 2021

for centos 7

$ yum install libcurl-devel

@Furqanameen
Copy link

thanks for your response it worked for me!

@Jenietoc
Copy link

@gabbio work for me, thank's

@M-Abdullah-11
Copy link

M-Abdullah-11 commented Jan 31, 2023

@gabbio

sudo apt-get install libcurl3-dev This should fix it

Thanks, man

@Nibuitoni
Copy link

@gabbio work for me, thank's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment