Closed gockle closed 3 years ago
Thanks for the report. I think this is related to Ruby 3 support mentioned in #509.
This should now be fixed with the most recent release. Let me know if you still have issues with the brew install.
arothian@ I tried the most recent release (0.7.0), while the install works fine on Mac, running cfn_nag_scan
on command line fails:
$ cfn_nag_scan --help
/usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:74:in `set_default_engine': Unable to find a compatible xml library. Ensure that you have installed or added to your Gemfile one of ox, oga, libxml, nokogiri or rexml (RuntimeError)
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:96:in `<class:Parser>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:7:in `<module:Xml>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:5:in `<module:Aws>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:3:in `<top (required)>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml.rb:8:in `require_relative'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml.rb:8:in `<top (required)>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core.rb:68:in `require_relative'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core.rb:68:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-kms-1.41.0/lib/aws-sdk-kms.rb:11:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-s3-1.87.0/lib/aws-sdk-s3.rb:11:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/rule_repos/s3_based_rule_repo.rb:3:in `<top (required)>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/custom_rule_loader.rb:8:in `require_relative'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/custom_rule_loader.rb:8:in `<top (required)>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/cfn_nag.rb:3:in `require_relative'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/cfn_nag.rb:3:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag.rb:3:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/bin/cfn_nag_scan:4:in `<top (required)>'
from /usr/local/bin/cfn_nag_scan:6:in `load'
from /usr/local/bin/cfn_nag_scan:6:in `<main>'
@arothian I can duplicate this error after the upgrade steps.
$ brew install ruby brew-gem
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
luv
==> Updated Formulae
Updated 56 formulae.
Warning: ruby 3.0.0_1 is already installed and up-to-date
To reinstall 3.0.0_1, run `brew reinstall ruby`
Warning: brew-gem 1.0.0 is already installed and up-to-date
To reinstall 1.0.0, run `brew reinstall brew-gem`
➜ $ brew gem install cfn-nag
==> Fetching cfn-nag from gem source
Fetching cfn-nag-0.7.0.gem
Downloaded cfn-nag-0.7.0
Warning: Cannot verify integrity of 'cfn-nag-0.7.0.gem'.
No checksum was provided for this resource.
For your reference, the checksum is:
sha256 "3bce69032d81f3df6f8c505204e0568d62d64f00dedb7889da0cebcb89649b7e"
==> /usr/local/opt/ruby/bin/gem install /Users/XXX/Library/Caches/Homebrew/cfn-nag-0.7.0.gem --no-document --no-wrapper --no-user-install --insta
🍺 /usr/local/Cellar/gem-cfn-nag/0.7.0: 1,136 files, 7.9MB, built in 15 seconds
$ cfn_nag initiation.template
/usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:74:in `set_default_engine': Unable to find a compatible xml library. Ensure that you have installed or added to your Gemfile one of ox, oga, libxml, nokogiri or rexml (RuntimeError)
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:96:in `<class:Parser>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:7:in `<module:Xml>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:5:in `<module:Aws>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml/parser.rb:3:in `<top (required)>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml.rb:8:in `require_relative'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core/xml.rb:8:in `<top (required)>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core.rb:68:in `require_relative'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-core-3.111.2/lib/aws-sdk-core.rb:68:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-kms-1.41.0/lib/aws-sdk-kms.rb:11:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/aws-sdk-s3-1.87.0/lib/aws-sdk-s3.rb:11:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/rule_repos/s3_based_rule_repo.rb:3:in `<top (required)>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/custom_rule_loader.rb:8:in `require_relative'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/custom_rule_loader.rb:8:in `<top (required)>'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/cfn_nag.rb:3:in `require_relative'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag/cfn_nag.rb:3:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/lib/cfn-nag.rb:3:in `<top (required)>'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/Cellar/gem-cfn-nag/0.7.0/gems/cfn-nag-0.7.0/bin/cfn_nag:4:in `<top (required)>'
from /usr/local/bin/cfn_nag:6:in `load'
from /usr/local/bin/cfn_nag:6:in `<main>'
Thanks, looks like this is related to some Ruby 3.0 changes made upstream in the ruby aws-sdk (https://github.com/aws/aws-sdk-ruby/pull/2459).
Thanks, looks like this is related to some Ruby 3.0 changes made upstream in the ruby aws-sdk (aws/aws-sdk-ruby#2459).
That PR was merged. So is it still occuring ? Btw I reverted to Ruby 2.7 and installed cfn-nag manually.
Hi I've got the same issue, however I installed cfn_nag using 'gem install' and it worked.
however still having issues via brew gem install.
This should be fixed in the latest version. Please let me know if still having issues with running the latest via homebrew.
Back in the office after a longer trip and just ran brew update and got a warning related to this issue report so I wanted to add this here for reference:
msa@verdandi ~ % brew --version
Homebrew 3.3.16-15-g6661f5b
Homebrew/homebrew-core (git revision 2468aa4748a; last commit 2022-02-22)
Homebrew/homebrew-cask (git revision 2d9c7603fe; last commit 2022-02-22)
msa@verdandi ~ % brew gem install cfn-nag
gem-cfn-nag 0.7.5 is already installed but outdated (so it will be upgraded).
==> Fetching cfn-nag from gem source
Fetching cfn-nag-0.8.9.gem
Downloaded cfn-nag-0.8.9
Warning: Cannot verify integrity of 'cfn-nag-0.8.9.gem'.
No checksum was provided for this resource.
For your reference, the checksum is:
sha256 "eae1d782bf7b9e89948c0c00986c5d9239d6955053d8a4da969095dea9b31493"
==> Upgrading gem-cfn-nag
0.7.5 -> 0.8.9
==> /usr/local/opt/ruby/bin/gem install /Users/msa/Library/Caches/Homebrew/cfn-nag-0.8.9.gem --no-do
🍺 /usr/local/Cellar/gem-cfn-nag/0.8.9: 1,236 files, 9.2MB, built in 13 seconds
==> Running `brew cleanup gem-cfn-nag`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/gem-cfn-nag/0.7.5... (1,224 files, 8.7MB)
Commands executed were,