I am trying to install plugin fluent-plugin-kubernetes_metadata_filter (2.6.0) in fluentd docker image v1.12.0-debian-1.0 and it failed with following error log -
Building native extensions. This could take a while...
ERROR: Error installing fluent-plugin-kubernetes_metadata_filter:
ERROR: Failed to build gem native extension.
current directory: /usr/local/bundle/gems/unf_ext-0.0.7.7/ext/unf_ext
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.6.0 -r ./siteconf20210303-21-1sa0zta.rb extconf.rb
checking for -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}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/$(RUBY_BASE_NAME)
--with-static-libstdc++
--without-static-libstdc++
--with-stdc++lib
--without-stdc++lib
/usr/local/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 /usr/local/lib/ruby/2.6.0/mkmf.rb:552:in `try_link0'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:789:in `try_func'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:1016:in `block in have_library'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from /usr/local/lib/ruby/2.6.0/mkmf.rb:1011: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:
/usr/local/bundle/extensions/x86_64-linux/2.6.0/unf_ext-0.0.7.7/mkmf.log
extconf failed, exit code 1
Could you help me identify and fix the issue ? i tried to install ruby-dev and no luck. the one possibility is to create new docker image with required extensions mentioned in the following luck.