Can't find the 'libpq-fe.h header
** 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.
Where do I find the mkmf.log file?
Can't find the 'libpq-fe.h header
** 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.
Where do I find the mkmf.log file?
The mkmf.log file can be found under the gem's installation directory.
rvm
If you are using RVM, then look for a directory similar to
~/.rvm/gems/ruby-1.9.3-p194/gems/some-cool-gem-name/ext/mkmf.log
You can list all the mkmf.log files available with this command:
find ~/.rvm -name mkmf.log
rbenv
find ~/.rbenv -name mkmf.log
find ~/.rvm -name mkmf.log
instead. It'll run much faster too ;)
Jun 9, 2014 at 10:30
mkmf.log
file.
illegal option
when using -name
flag. Is that a Linux thing?
Oct 31, 2015 at 14:49
find -name mkmf.log
. the first parameter of find needs to be the start directory, like find . -name mkmf.log
for instance
May 16, 2016 at 5:31
Windows solution
As @givanse said, the mkmf logs are in the gem installation directory. Because that can be complicated, you should just search for the mkmf file. You can do that in Windows explorer or in PowerShell
cd C:\Dev\Ruby22 # Change to reflect your Ruby install dir
Get-ChildItem mkmf* -Recurse
find $GEM_HOME -name mkmf.log
or
$GEM_HOME/extensions/$arch/$ruby_version-static/$gem_name-$gem_version/mkmf.log
chruby
, ruby-2.6.3
:
GEM_HOME: /home/yuri/.gem/ruby/2.6.3
arch: x86_64-linux
ruby_version: 2.6.0
gem_name: openssl
gem_version: 2.0.0
/home/yuri/.gem/ruby/2.6.3/extensions/x86_64-linux/2.6.0-static/openssl-2.0.0/mkmf.log
rvm
, ruby-2.6.3
:
GEM_HOME: /home/yuri/.rvm/gems/ruby-2.6.3
arch: x86_64-linux
ruby_version: 2.6.0
gem_name: nokogiri
gem_version: 1.10.3
/home/yuri/.gem/ruby/2.6.3/extensions/x86_64-linux/2.6.0-static/nokogiri-1.10.3/mkmf.log