- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
This occured to me when trying to install jekyll-webmention_io, see aarongustafson/jekyll-webmention_io#75.
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using public_suffix 2.0.5
Using addressable 2.5.1
Using bundler 1.16.0
Using colorator 1.1.0
Fetching unf_ext 0.0.7.5
Installing unf_ext 0.0.7.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: $HOME/.gem/ruby/2.3.0/gems/unf_ext-0.0.7.5/ext/unf_ext
/usr/bin/ruby23 -r ./siteconf20180225-16640-mruchr.rb extconf.rb
checking for main() in -lstdc++... *** 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)23
--with-static-libstdc++
--without-static-libstdc++
--with-stdc++lib
--without-stdc++lib
/usr/lib64/ruby/2.3.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/lib64/ruby/2.3.0/mkmf.rb:541:in `try_link0'
from /usr/lib64/ruby/2.3.0/mkmf.rb:556:in `try_link'
from /usr/lib64/ruby/2.3.0/mkmf.rb:765:in `try_func'
from /usr/lib64/ruby/2.3.0/mkmf.rb:997:in `block in have_library'
from /usr/lib64/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from /usr/lib64/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /usr/lib64/ruby/2.3.0/mkmf.rb:320:in `open'
from /usr/lib64/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from /usr/lib64/ruby/2.3.0/mkmf.rb:320:in `open'
from /usr/lib64/ruby/2.3.0/mkmf.rb:346:in `postpone'
from /usr/lib64/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from /usr/lib64/ruby/2.3.0/mkmf.rb:992:in `have_library'
from extconf.rb:6:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be
found here:
$HOME/.gem/ruby/2.3.0/extensions/x86_64-linux/2.3.0/unf_ext-0.0.7.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in $HOME/.gem/ruby/2.3.0/gems/unf_ext-0.0.7.5
for inspection.
Results logged to
$HOME/.gem/ruby/2.3.0/extensions/x86_64-linux/2.3.0/unf_ext-0.0.7.5/gem_make.out
An error occurred while installing unf_ext (0.0.7.5), and Bundler cannot
continue.
Make sure that `gem install unf_ext -v '0.0.7.5'` succeeds before bundling.
In Gemfile:
jekyll-webmention_io was resolved to 2.8.5, which depends on
http was resolved to 2.2.2, which depends on
http-cookie was resolved to 1.0.3, which depends on
domain_name was resolved to 0.5.20170404, which depends on
unf was resolved to 0.1.4, which depends on
unf_ext
sarahbakal, davidmann4, Willis0826, jiangxiaoqiang and kubatruhlar
Activity
grasp commentedon Apr 18, 2018
any solution on this?
grasp commentedon Apr 18, 2018
my solution is : apt-get install g++
silverhammermba commentedon Apr 27, 2018
Nothing to do with this extension:
This is telling you that you don't have a C++ compiler installed. You won't be able to install any native extensions that use C++.
Ryuno-Ki commentedon May 13, 2018
G++ is installed
Still the same error.
kjian commentedon May 22, 2018
same here:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
checking for main() in -lstdc++... yes
creating Makefile
...
unf was resolved to 0.1.4, which depends on
unf_ext
kjian commentedon May 22, 2018
I have installed multiple Xcode in /Applications, when compiling unf_ext, it selected the wrong Xcode.
So, when i reset the compiling toolchain to default, it worked.
sudo xcode-select -r
Ryuno-Ki commentedon Jun 2, 2018
Now we just need to find a pendant on Linux :-)
JoshuaEdwards1991 commentedon Jul 13, 2018
Any fix for this?
kanstantsin-klachkou commentedon Jul 30, 2018
gem install unf_ext -v '0.0.7.5'
and then try again
bundle install
inertia186 commentedon Nov 23, 2018
Well, it says to do that right in the error. Why didn't I think of that?
talezion commentedon Oct 13, 2019
Any solutions?
I get the same error.
sudo gem install unf_ext -v '0.0.7.6' --source 'https://rubygems.org/'
I was setting fastlane with Firebase Distribution and had to run
bundle update
fastlane add_plugin firebase_app_distribution
talezion commentedon Oct 13, 2019
I updated ruby to 2.6.3 and is works now!
marlti7 commentedon Dec 23, 2019
Any fix for this?
hokita commentedon Mar 4, 2020
Any fix for this? ruby 2.6.5 doesn't work
KlausLiu commentedon Nov 14, 2020
Any fix for this? ruby 2.6.0 doesn't work
AndiBrunner commentedon Jan 7, 2021
I had the same issue, installing ruby-dev helped.
$ sudo apt-get install ruby-dev