Open Poweranimal opened 2 years ago
I got the same error today.
@Poweranimal @manuelnucci I had the same problem. To solve it, I had to install 3 packages before the command "gem install cfn-nag" Here is my Dockerfile from ruby 3.3 in Alpine 3.20. Try the apk add...
ARG RUBY_VERSION=3.3
FROM ruby:${RUBY_VERSION}-alpine
ARG PKG_LIST='gcc musl-dev make'
RUN apk add --no-cache ${PKG_LIST} \
&& gem update --system \
&& gem install cfn-nag \
&& apk del --purge --rdepends --no-cache ${PKG_LIST}
ENTRYPOINT ["cfn_nag"]
CMD ["--help"]
Hi,
Installing the cfn-nag (
v0.8.10
) gem onalpine3.16.1
fails with the following error:ERROR
```text Building native extensions. This could take a while... ERROR: Error installing cfn-nag: ERROR: Failed to build gem native extension. current directory: /usr/local/bundle/gems/psych-3.3.2/ext/psych /usr/local/bin/ruby -I /usr/local/lib/ruby/3.1.0 -r ./siteconf20220730-14-dy0ixb.rb extconf.rb checking for yaml.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 --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-libyaml-dir --without-libyaml-dir --with-libyaml-include --without-libyaml-include=${libyaml-dir}/include --with-libyaml-lib --without-libyaml-lib=${libyaml-dir}/lib --enable-bundled-libyaml --disable-bundled-libyaml /usr/local/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/local/lib/ruby/3.1.0/mkmf.rb:624:in `block in try_compile' from /usr/local/lib/ruby/3.1.0/mkmf.rb:573:in `with_werror' from /usr/local/lib/ruby/3.1.0/mkmf.rb:624:in `try_compile' from /usr/local/lib/ruby/3.1.0/mkmf.rb:1213:in `block in find_header' from /usr/local/lib/ruby/3.1.0/mkmf.rb:1007:in `block in checking_for' from /usr/local/lib/ruby/3.1.0/mkmf.rb:362:in `block (2 levels) in postpone' from /usr/local/lib/ruby/3.1.0/mkmf.rb:332:in `open' from /usr/local/lib/ruby/3.1.0/mkmf.rb:362:in `block in postpone' from /usr/local/lib/ruby/3.1.0/mkmf.rb:332:in `open' from /usr/local/lib/ruby/3.1.0/mkmf.rb:358:in `postpone' from /usr/local/lib/ruby/3.1.0/mkmf.rb:1006:in `checking_for' from /usr/local/lib/ruby/3.1.0/mkmf.rb:1212:in `find_header' from extconf.rb:10:in `Steps to reproduce
Dockerfile:
Run
docker build