Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fail on Linux #40

Open
Ryuno-Ki opened this issue Mar 6, 2018 · 16 comments
Open

Build fail on Linux #40

Ryuno-Ki opened this issue Mar 6, 2018 · 16 comments

Comments

@Ryuno-Ki
Copy link

Ryuno-Ki commented Mar 6, 2018

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
@grasp
Copy link

grasp commented Apr 18, 2018

any solution on this?

@grasp
Copy link

grasp commented Apr 18, 2018

my solution is : apt-get install g++

@silverhammermba
Copy link

Nothing to do with this extension:

checking for main() in -lstdc++... *** extconf.rb failed *** 

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
Copy link
Author

G++ is installed

LC_ALL=C g++ --version
g++ (Gentoo Hardened 6.4.0-r1 p1.3) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Still the same error.

@kjian
Copy link

kjian commented May 22, 2018

same here:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/kjian/.rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20180522-62521-1v2gv2c.rb extconf.rb

checking for main() in -lstdc++... yes
creating Makefile
...
unf was resolved to 0.1.4, which depends on
unf_ext

@kjian
Copy link

kjian commented 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
Copy link
Author

Ryuno-Ki commented Jun 2, 2018

Now we just need to find a pendant on Linux :-)

@JoshuaEdwards1991
Copy link

Any fix for this?

@kanstantsin-klachkou
Copy link

kanstantsin-klachkou commented Jul 30, 2018

gem install unf_ext -v '0.0.7.5'

and then try again bundle install

@inertia186
Copy link

Well, it says to do that right in the error. Why didn't I think of that?

@talezion
Copy link

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

Fetching unf_ext 0.0.7.6
Installing unf_ext 0.0.7.6 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

An error occurred while installing unf_ext (0.0.7.6), and Bundler
cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.6' --source
'https://rubygems.org/'` succeeds before bundling.

@talezion
Copy link

I updated ruby to 2.6.3 and is works now!

@marlti7
Copy link

marlti7 commented Dec 23, 2019

Any fix for this?

@hokita
Copy link

hokita commented Mar 4, 2020

Any fix for this? ruby 2.6.5 doesn't work

@KlausLiu
Copy link

Any fix for this? ruby 2.6.0 doesn't work

@AndiBrunner
Copy link

I had the same issue, installing ruby-dev helped.

$ sudo apt-get install ruby-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests