Skip to content

berkshelf install via gem suddenly stopped working #22

@adriantaut

Description

@adriantaut

Description

Suddently getting this error without changing much in my automation, any thoughts?

[root@ip-10-174-6-204 ~]# chef-client --version
Chef Infra Client: 18.0.185

[root@ip-10-174-6-204 ~]# /opt/chef/embedded/bin/ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

[root@ip-10-174-6-204 ~]# /opt/chef/embedded/bin/gem -v
3.3.7

[root@ip-10-174-6-204 ~]# /opt/chef/embedded/bin/gem install berkshelf
Building native extensions. This could take a while...
ERROR:  Error installing berkshelf:
	ERROR: Failed to build gem native extension.

    current directory: /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ffi-1.16.2/ext/ffi_c
/opt/chef/embedded/bin/ruby -I /opt/chef/embedded/lib/ruby/3.1.0 -r ./siteconf20230926-1695-u46cd0.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
	--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-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-debug
	--disable-debug
	--enable-system-libffi
	--disable-system-libffi
	--with-libffi-dir
	--without-libffi-dir
	--with-libffi-include
	--without-libffi-include=${libffi-dir}/include
	--with-libffi-lib
	--without-libffi-lib=${libffi-dir}/lib
	--with-libffi-config
	--without-libffi-config
	--with-pkg-config
	--without-pkg-config
	--with-ffi-dir
	--without-ffi-dir
	--with-ffi-include
	--without-ffi-include=${ffi-dir}/include
	--with-ffi-lib
	--without-ffi-lib=${ffi-dir}/lib
/opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:509: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/3.1.0/mkmf.rb:635:in `block in try_compile'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:584:in `with_werror'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:635:in `try_compile'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:1171:in `block in have_header'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:1018:in `block in checking_for'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:362:in `block (2 levels) in postpone'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:332:in `open'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:362:in `block in postpone'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:332:in `open'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:358:in `postpone'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:1017:in `checking_for'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:1170:in `have_header'
	from extconf.rb:10:in `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:

  /opt/chef/embedded/lib/ruby/gems/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.16.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ffi-1.16.2 for inspection.
Results logged to /opt/chef/embedded/lib/ruby/gems/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.16.2/gem_make.out

thank you!

Berkshelf Version

tried installing v8.0.7 & v8.0.8

Platform Version

CentOS 7

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