Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fails to bundle install with Ruby 4.0.0_preview2 #1168

@sergiodj

Description

@sergiodj

Hi,

I'm testing packages with Ruby 4.0.0_preview (the latest preview for the upcoming 4.0 release), and I noticed that the following will fail:

$ cat > G << _EOF_
source 'https://rubygems.org'
gem 'ffi'
_EOF_
$ bundle install --gemfile G
Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/..                                                       
Resolving dependencies...                                                                                
Fetching ffi 1.17.2                                                                                      
Installing ffi 1.17.2 with native extensions                                                             
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.            
                                                                                                         
    current directory: /usr/lib/ruby/gems/4.0.0+0/gems/ffi-1.17.2/ext/ffi_c   
/usr/bin/ruby extconf.rb                                                                                 
checking for pkg-config for libffi... not found                                                          
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=${opt-dir}/include
        --without-opt-include
        --with-opt-lib=${opt-dir}/lib                                                                    
        --without-opt-lib                                                                                
        --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=${ffi_c-dir}/include                                                        
        --without-ffi_c-include                                                                                                                                                                                    
        --with-ffi_c-lib=${ffi_c-dir}/lib                                                                                                                                                                          
        --without-ffi_c-lib                                                                                                                                                                                        
        --enable-debug                                                                                   
        --disable-debug                                                                                                                                                                                            
        --enable-system-libffi                                                                                                                                                                                     
        --disable-system-libffi                                                                                                                                                                                    
        --with-libffi-dir                                                                                                                                                                                          
        --without-libffi-dir                                                                                                                                                                                       
        --with-libffi-include=${libffi-dir}/include                                                      
        --without-libffi-include                                                                                                                                                                                   
        --with-libffi-lib=${libffi-dir}/lib                                                              
        --without-libffi-lib                                                                                                                                                                                       
        --with-libffi-config                                                                                                                                                                                       
        --without-libffi-config
        --with-pkg-config                                                                                
        --without-pkg-config
        --with-ffi-dir
        --without-ffi-dir
        --with-ffi-include=${ffi-dir}/include
        --without-ffi-include
        --with-ffi-lib=${ffi-dir}/lib
        --without-ffi-lib
/usr/lib/ruby/4.0.0+0/mkmf.rb:528:in 'MakeMakefile#try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

        from /usr/lib/ruby/4.0.0+0/mkmf.rb:655:in 'MakeMakefile#try_compile'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:1242:in 'block in MakeMakefile#have_header'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:1070:in 'block in MakeMakefile#checking_for'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:370:in 'block (2 levels) in MakeMakefile::Logging.postpone'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:340:in 'MakeMakefile::Logging.open'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:370:in 'block in MakeMakefile::Logging.postpone'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:340:in 'MakeMakefile::Logging.open'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:366:in 'MakeMakefile::Logging.postpone'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:1069:in 'MakeMakefile#checking_for'
        from /usr/lib/ruby/4.0.0+0/mkmf.rb:1241:in 'MakeMakefile#have_header'
        from extconf.rb:10:in 'Object#system_libffi_usable?'
        from extconf.rb:46:in '<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /usr/lib/ruby/gems/4.0.0+0/extensions/x86_64-linux-gnu/4.0.0+0/ffi-1.17.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/lib/ruby/gems/4.0.0+0/gems/ffi-1.17.2 for inspection.
Results logged to /usr/lib/ruby/gems/4.0.0+0/extensions/x86_64-linux-gnu/4.0.0+0/ffi-1.17.2/gem_make.out

  /usr/lib/ruby/4.0.0+0/rubygems/ext/builder.rb:129:in 'Gem::Ext::Builder.run'
  /usr/lib/ruby/4.0.0+0/rubygems/ext/ext_conf_builder.rb:30:in 'Gem::Ext::ExtConfBuilder.build'
  /usr/lib/ruby/4.0.0+0/rubygems/ext/builder.rb:210:in 'Gem::Ext::Builder#build_extension'
  /usr/lib/ruby/4.0.0+0/rubygems/ext/builder.rb:244:in 'block in Gem::Ext::Builder#build_extensions'
  /usr/lib/ruby/4.0.0+0/rubygems/ext/builder.rb:241:in 'Array#each'
  /usr/lib/ruby/4.0.0+0/rubygems/ext/builder.rb:241:in 'Gem::Ext::Builder#build_extensions'
  /usr/lib/ruby/4.0.0+0/rubygems/installer.rb:808:in 'Gem::Installer#build_extensions'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/rubygems_gem_installer.rb:111:in 'Bundler::RubyGemsGemInstaller#build_extensions'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/rubygems_gem_installer.rb:30:in 'Bundler::RubyGemsGemInstaller#install'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/source/rubygems.rb:217:in 'block in Bundler::Source::Rubygems#install'
  /usr/lib/ruby/4.0.0+0/rubygems.rb:1051:in 'Gem.time'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/source/rubygems.rb:216:in 'Bundler::Source::Rubygems#install'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/installer/gem_installer.rb:54:in 'Bundler::GemInstaller#install'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/installer/gem_installer.rb:17:in 'Bundler::GemInstaller#install_from_spec'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/installer/parallel_installer.rb:133:in 'Bundler::ParallelInstaller#do_install'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/installer/parallel_installer.rb:124:in 'block in Bundler::ParallelInstaller#worker_pool'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/worker.rb:62:in 'Bundler::Worker#apply_func'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/worker.rb:57:in 'block in Bundler::Worker#process_queue'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/worker.rb:54:in 'Kernel#loop'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/worker.rb:54:in 'Bundler::Worker#process_queue'
  /usr/lib/ruby/gems/4.0.0+0/gems/bundler-4.0.0/lib/bundler/worker.rb:90:in 'block (2 levels) in Bundler::Worker#create_threads'

An error occurred while installing ffi (1.17.2), and Bundler cannot continue.

In G:
  ffi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions