stelligent / cfn_nag

Linting tool for CloudFormation templates
MIT License
1.25k stars 209 forks source link

linux homebrew installation failure #585

Open strannik19 opened 2 years ago

strannik19 commented 2 years ago

Failure to install using homebrew

Commands Executed

brew install ruby brew-gem
brew gem install cfn-nag

Error Message

Building native extensions. This could take a while...
ERROR:  Error installing /home/asdfasdf/.cache/Homebrew/cfn-nag-0.8.8.gem:
        ERROR: Failed to build gem native extension.

    current directory: /home/linuxbrew/.linuxbrew/Cellar/gem-cfn-nag/0.8.8/gems/psych-3.3.2/ext/psych
/home/linuxbrew/.linuxbrew/opt/ruby/bin/ruby -I /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0 -r ./siteconf20211229-141284-qwz0fi.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
        --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=/home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/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
/home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:471:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:613:in `try_cpp'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:1177:in `block in find_header'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:971:in `block in checking_for'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:361:in `block (2 levels) in postpone'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:361:in `block in postpone'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:357:in `postpone'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:970:in `checking_for'
        from /home/linuxbrew/.linuxbrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/mkmf.rb:1176:in `find_header'
        from extconf.rb:10:in `<main>'

Versions

uname -r 5.13.0-22-generic

Ubuntu release: Ubuntu 20.04.3 LTS

homebrew: brew --version
Homebrew 3.3.9-80-g26694fd Homebrew/homebrew-core (git revision 3e77e639f54; last commit 2021-12-29) Homebrew/homebrew-cask (git revision d7ab4145f0; last commit 2021-12-29)

ruby: 3.0.3

brew gem: 1.1.1

arothian commented 2 years ago

Hi @strannik19 , I was unable to reproduce this error on Ubuntu 20 LTS.

It looks like you are missing native libs for installing the ruby components. Can could try verifying that libyaml cask was installed correctly as a dependency when you ran brew install ruby?