I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link.
Heres the full post:
root#cherob:~# gem install jekyll
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
checking for ffi.h... *** 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/bin/ruby2.1
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/usr/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
from /usr/lib/ruby/2.1.0/mkmf.rb:1067:in `block in have_header'
from /usr/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from /usr/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /usr/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from /usr/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /usr/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from /usr/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from /usr/lib/ruby/2.1.0/mkmf.rb:1066:in `have_header'
from extconf.rb:16:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/ffi-1.9.18 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0
/ffi-1.9.18/gem_make.outstrong text
Ruby is installed:
root#cherob:~# ruby -v
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
Debain 8 is installed
-
Apache2 is installed:
root#cherob:~# apache2 -v
Server version: Apache/2.4.10 (Debian)
Server built: Sep 20 2017 04:37:43
If you have an idea I would be glad if you forward me it.
Other thanks already times in advance
Robin
Such error usually means that you don't have build tools installed.
As far as I understood you are using linux, so you can run something like
apt-get install build-essential
This command is for deb-bases distros. So you can use something similar if you use a different distro.
I had the same error while installing. You will have to install des Ruby dev packacke:
sudo apt-get install ruby2.4-dev
This will install the developement package for 2.4. You should install 2.1 as you are using this version. I had the problem, that the package could not be found in the repositories. So I used the following PPA:
$ sudo apt-add-repository ppa:brightbox/ruby-ng
$ sudo apt-get update
https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng
Version 2.1 is also available in this repository.
Related
Use root user installed rubygems.
# yum install rubygems -y
When check ruby's version, got
# ruby -v
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux]
Gem's version:
# gem -v
2.7.6.3
When install a gem, got
# gem install fluent-plugin-kinesis
Building native extensions. This could take a while...
ERROR: Error installing fluent-plugin-kinesis:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/msgpack-1.4.2/ext/msgpack
/usr/bin/ruby -r ./siteconf20210825-20925-17fyw57.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/msgpack-1.4.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/msgpack-1.4.2/gem_make.out
Should I install a high version ruby? It's the default one on the system.
update
I installed ruby-devel
# yum install ruby-devel.x86_64
Run install fluent-plugin-kinesis gem again
# gem install fluent-plugin-kinesis
Building native extensions. This could take a while...
ERROR: Error installing fluent-plugin-kinesis:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/msgpack-1.4.2/ext/msgpack
/usr/bin/ruby -r ./siteconf20210826-11878-18i9eps.rb extconf.rb
checking for ruby/st.h... *** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:590:in `try_cpp'
from /usr/share/ruby/mkmf.rb:1098:in `block in have_header'
from /usr/share/ruby/mkmf.rb:948:in `block in checking_for'
from /usr/share/ruby/mkmf.rb:350:in `block (2 levels) in postpone'
from /usr/share/ruby/mkmf.rb:320:in `open'
from /usr/share/ruby/mkmf.rb:350:in `block in postpone'
from /usr/share/ruby/mkmf.rb:320:in `open'
from /usr/share/ruby/mkmf.rb:346:in `postpone'
from /usr/share/ruby/mkmf.rb:947:in `checking_for'
from /usr/share/ruby/mkmf.rb:1097:in `have_header'
from extconf.rb:3:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib64/gems/ruby/msgpack-1.4.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/msgpack-1.4.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/msgpack-1.4.2/gem_make.out
For other gems works well.
Take a look at the docs or this answer.
Install Ruby >= 2.4 on your local environment. In addition, install ruby-dev package via Package Manager to build native extension gems.
I believe in CentOS ruby-dev equivalent is ruby-devel. You can confirm it by running yum search ruby-dev
You'll find 2 packages, one i686 and another x86_64. You can find which one you need by running lscpu | grep Arch.
Then simply download the package, and rerun gem install
Cocoapods installation failed,
Version:
macOS Catalina 10.15.4
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
Homebrew 2.2.6
gem 3.1.2
gem sources -l
*** CURRENT SOURCES ***
https://gems.ruby-china.com
sudo gem install cocoapod
or
sudo gem install -n /usr/local/bin cocoapods
Error result:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20200409-15528-unemw5.rb extconf.rb
checking for ffi.h... * 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=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--enable-system-libffi
--disable-system-libffi
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:inblock in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:intry_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in block in have_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:inblock in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:inopen'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:inopen'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:inchecking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in have_header'
from extconf.rb:10:insystem_libffi_usable?'
from extconf.rb:34:in `'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out
If you solve this problem?
I fixed it by running
brew install cocoapods
And
You may want to remove it:
rm '/usr/local/bin/pod'
To force the link and overwrite all conflicting files:
brew link --overwrite cocoapods
Install homebrew if you haven't already. https://brew.sh/
Try adding --disable-system-libffi to the gem install command.
This worked for me:
gem inst cocoapods -- --disable-system-libffi
These lines of code can help to install any pods to your project on a Macbook M1.
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
I am executing gem install pg to install the pg and execute chef scripts afterwards in Redhat AWS machine. I am getting following error:
gem install pg Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/pg-1.1.4/ext/opt/chef/embedded/bin/ruby -r ./siteconf20190924-20230-k0ngu5.rb extconf.rb
checking for pg_config... yes
Using config values from /bin/pg_config
checking for libpq-fe.h...
*** 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
--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=/opt/chef/embedded/bin/$(RUBY_BASE_NAME)
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
/opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:601:in `try_cpp'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:1162:in `block in find_header'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:959:in `block in checking_for'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:320:in `open'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:350:in `block in postpone'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:320:in `open'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:346:in `postpone'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:958:in `checking_for'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:1161:in `find_header'
from extconf.rb:54:in `<main>'
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/opt/chef/embedded/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/pg-1.1.4/mkmf.log
extconf failed, exit code 1
I am trying this with root user. I have installed postgresql-devel too using yum and tried to provide --with-pg-include too where libpq-fe.h resides (suggested in some other posts) but couldn't resolve the issue.
You first need to install build tools (i.e. a C compiler and related tools) as well as development headers for your postgres server to be able to compile the gem.
For RedHat, you should be able to get all required tools with
yum install autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch
yum install postgresql-devel
With Chef 14, you can use the built-in build_essential resource to install the required compiler packages. On older versions, you can use the build-essential cookbook.
Ruby version 2.2.4p230
RubyGem version 2.7.2
Ruby-devel and lib64ffi-devel installed.
64-bit OpenMandriva 3.0, urpmi and rpmdrake used.
Goal: to install compass, but the gem ffi is needed first.
I have scoured the internet so hard for the last two days and I'm so stumped... It's impossible for me to install an earlier version of ruby because of the dependency for an older ncurses. I feel like replacing ncurses would open a can of nasty worms.
However... I am also completely open to a compass alternative, where the config.rb project files could be somehow ported / copied so both compass and this other sass compiler could operate. (this is for work and we're not changing the sass builder any time soon).
/usr/share/gems/gems/ffi-1.9.18/ext/ffi_c totally exists, there is an ffi.c file in that directory but can't find any ffi.h file in the vicinity. In a moment of desperation I touched ffi.h in that dir and when I ran gem install it removed it. ;) I would try taking a copy of someone else's libs to see if that works.
Basically any way to get this working without breaking the rest of my packages. I don't use ruby for anything else, just compass.
Here is the output:
# sudo gem install ffi
Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.
current directory: /usr/share/gems/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby -r ./siteconf20171110-17988-1lodsok.rb extconf.rb
checking for ffi.h... *** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib64
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:587:in `try_cpp'
from /usr/share/ruby/mkmf.rb:1060:in `block in have_header'
from /usr/share/ruby/mkmf.rb:911:in `block in checking_for'
from /usr/share/ruby/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/share/ruby/mkmf.rb:321:in `open'
from /usr/share/ruby/mkmf.rb:351:in `block in postpone'
from /usr/share/ruby/mkmf.rb:321:in `open'
from /usr/share/ruby/mkmf.rb:347:in `postpone'
from /usr/share/ruby/mkmf.rb:910:in `checking_for'
from /usr/share/ruby/mkmf.rb:1059:in `have_header'
from extconf.rb:16:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/lib64/gems/ruby/ffi-1.9.18/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/share/gems/gems/ffi-1.9.18 for inspection.
Results logged to /usr/lib64/gems/ruby/ffi-1.9.18/gem_make.out
Any help appreciated!
Your error message shows:
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
And that's how you can solve it:
xcode-select --install
(but make sure beforehand that xcode-select -p is returning the path to a stable Xcode version, like Xcode 10)
See also https://github.com/ffi/ffi/issues/647.
I am trying to install charlock holmes, nevertheless, I keep getting an error:
[root#hugovm gitlab]# gem install charlock_holmes --version '0.6.9.4'
Building native extensions. This could take a while...
ERROR: Error installing charlock_holmes:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for main() in -licui18n... yes
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... yes
-- tar zxvf file-5.08.tar.gz
-- ./configure --prefix=/usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/dst/ --disable-shared --enable-static --with-pic
-- patch -p0 < ../file-soft-check.patch
*** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-icu-dir
--without-icu-dir
--with-icu-include
--without-icu-include=${icu-dir}/include
--with-icu-lib
--without-icu-lib=${icu-dir}/
--with-icui18nlib
--without-icui18nlib
--with-icui18nlib
--without-icui18nlib
extconf.rb:7:in `sys': patch -p0 < ../file-soft-check.patch failed, please report issue on http://github.com/brianmario/charlock_holmes (RuntimeError)
from extconf.rb:61:in `block (2 levels) in <main>'
from extconf.rb:59:in `chdir'
from extconf.rb:59:in `block in <main>'
from extconf.rb:55:in `chdir'
from extconf.rb:55:in `<main>'
Gem files will remain installed in /usr/local/share/gems/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/gem_make.out
I already installed libicu-devel.
Thanks
I had the exact same issue today. Tried to install gitlab on a clean fedora machine.
For me, a line in /usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/gem_make.out pointed to mkmf.log, which is in the same directory as above log file.
There it said "patch: command not found"
sudo yum install patch
In you output I can read:
extconf.rb:7:in `sys': patch -p0 < ../file-soft-check.patch failed, please report issue on http://github.com/brianmario/charlock_holmes (RuntimeError)
So it all points to a bug. I suppose it is a good idea follow the output and created an issue there, explaining what you are trying to do and giving details of your environment.
ruby-devel is missing
yum install ruby-devel
and you'll be set :)