-
Notifications
You must be signed in to change notification settings - Fork 208
Homebrew install instructions need updating since Ruby 4 release on Dec 25, 2025 #636
Copy link
Copy link
Open
Description
Ruby 4 was released on December 25th, 2025.
Ruby 4 broke the API used by cfn-nag's dependency kwalify, which hasn't been updated in 17 years. The Kwalify repo got archived in January 2026.
I think brew-gem has an unqualified dependency on ruby, which worked in ruby@3 (which maps to ruby@3.4, but not in ruby@4.
But when I run brew install brew-gem, as the instruction say, it installs ruby unqualified as v4.
I was able to get it working with the following script, but it's not ideal since I have to manage the weird path exports.
# uninstall all the ruby stuff from brew, then proceed
brew install ruby@3
echo 'export PATH="/opt/homebrew/opt/ruby@3/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/lib/ruby/gems/3.4.0/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
gem install cfn-nag
cfn_nag_scan -v
# 0.8.10The install instructions which caused me grief because of the ruby 4 update is as follows (copied from the README.md)
brew install ruby brew-gem
brew gem install cfn-nag
# even the following failed even after uninstalling the v4 version
brew install ruby@3 brew-gem
brew gem install cfn-nag
The error I got while following the instructions:
cfn_nag_scan --version
/opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/parser/base.rb:63:in 'Kwalify::BaseParser#peep': undefined method 'peep' for an instance of StringScanner (NoMethodError)
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/parser/yaml.rb:466:in 'Kwalify::Yaml::Parser#parse_block_scalar'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/parser/yaml.rb:301:in 'Kwalify::Yaml::Parser#parse_block_value'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/parser/yaml.rb:398:in 'Kwalify::Yaml::Parser#_parse_map_value'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/parser/yaml.rb:440:in 'Kwalify::Yaml::Parser#parse_block_map'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/parser/yaml.rb:269:in 'Kwalify::Yaml::Parser#parse_block_value'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/parser/yaml.rb:152:in 'Kwalify::Yaml::Parser#parse_next'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/parser/yaml.rb:129:in 'Kwalify::Yaml::Parser#parse'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/meta-validator.rb:34:in 'Kwalify::MetaValidator.instance'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/meta-validator.rb:269:in '<module:Kwalify>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify/meta-validator.rb:13:in '<top (required)>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify.rb:19:in 'Kernel#require'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/kwalify-0.7.2/lib/kwalify.rb:19:in '<top (required)>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-model-0.6.6/lib/cfn-model/validator/cloudformation_validator.rb:4:in 'Kernel#require'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-model-0.6.6/lib/cfn-model/validator/cloudformation_validator.rb:4:in '<top (required)>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:7:in 'Kernel#require'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-model-0.6.6/lib/cfn-model/parser/cfn_parser.rb:7:in '<top (required)>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-model-0.6.6/lib/cfn-model.rb:3:in 'Kernel#require'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-model-0.6.6/lib/cfn-model.rb:3:in '<top (required)>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-nag-0.8.10/lib/cfn-nag/custom_rule_loader.rb:3:in 'Kernel#require'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-nag-0.8.10/lib/cfn-nag/custom_rule_loader.rb:3:in '<top (required)>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-nag-0.8.10/lib/cfn-nag/cfn_nag.rb:3:in 'Kernel#require_relative'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-nag-0.8.10/lib/cfn-nag/cfn_nag.rb:3:in '<top (required)>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-nag-0.8.10/lib/cfn-nag.rb:3:in 'Kernel#require'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-nag-0.8.10/lib/cfn-nag.rb:3:in '<top (required)>'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-nag-0.8.10/bin/cfn_nag_scan:4:in 'Kernel#require'
from /opt/homebrew/Cellar/gem-cfn-nag/0.8.10/gems/cfn-nag-0.8.10/bin/cfn_nag_scan:4:in '<top (required)>'
from /opt/homebrew/bin/cfn_nag_scan:6:in 'Kernel#load'
from /opt/homebrew/bin/cfn_nag_scan:6:in '<main>'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels