Error Running `packwerk validate` After Update: Uninitialized Constant Error

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

I’m getting an error running packwerk validate today (which I didn’t get last week!):

packwerk validate
📦 Packwerk is running validation...
/Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/packwerk-2.2.0/lib/packwerk/package_set.rb:45:in `package_paths': uninitialized constant #<Class:Packwerk::PackageSet>::Bundler (NameError)
	from /Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/sorbet-runtime-0.5.10416/lib/types/private/methods/call_validation.rb:157:in `bind_call'
	from /Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/sorbet-runtime-0.5.10416/lib/types/private/methods/call_validation.rb:157:in `validate_call'
	from /Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/sorbet-runtime-0.5.10416/lib/types/private/methods/_methods.rb:270:in `block in _on_method_added'
	from /Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/packwerk-2.2.0/lib/packwerk/package_set.rb:24:in `load_all_from'
	from /Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/sorbet-runtime-0.5.10416/lib/types/private/methods/call_validation.rb:157:in `bind_call'
	from /Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/sorbet-runtime-0.5.10416/lib/types/private/methods/call_validation.rb:157:in `validate_call'
	from /Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/sorbet-runtime-0.5.10416/lib/types/private/methods/_methods.rb:270:in `block in _on_method_added'
	from /Users/gap/.rbenv/versions/3.0.4/lib/ruby/gems/3.0.0/gems/packwerk-2.2.0/lib/packwerk/application_validator.rb:25:in `initialize'

Anyone know whats going on?

It looks like we’re missing a require 'bundler'. I thought at first it had to do with a change to requires in ruby in ruby 3.0, but packwerk tests that version of ruby

Does bundle exec packwerk validate fix this by chance?