Error with Packs Gem and Dependency on Robocop-Packs: Missing Base Class in Privacy Checker File

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

Message originally sent by slack user U72NG7VKI06

Hi all, sorry if this is not the right channel for this question. I’m starting to implement the whole suite of tools and starting progressive modularization of a codebase, but I’m struggling with an error when trying to use packs gem, which has a dependency with robocop-packs .
Apparently, the error seems to be a missing Base class.
The error message is the following one:

gems/rubocop-packs-0.0.42/lib/rubocop/cop/packwerk_lite/privacy_checker.rb:40:in `<module:PackwerkLite>': uninitialized constant RuboCop::Cop::PackwerkLite::Base (NameError)

Hi Martin! What command are you running that produces this error?

Message originally sent by slack user U72NG7VKI06

Hi! The error is raised when I try to run rails console for example.
Also if I run packs help the error is raised too, when I run bundle binstub packs and run bin/packs help the error is different

What about bundle exec rails console or bundle exec packs help?

How is the error different after generating and using the binstub?

Message originally sent by slack user U72NG7VKI06

The error persists when use bundle exec rails console and bundle exec packs help

Message originally sent by slack user U72NG7VKI06

The other error is:

`gemfile': undefined method `present?' for "/Users/martingerez/workspace/geotecERP/Gemfile":String (NoMethodError)

using bin/packs help

That looks like some error in your Gemfile . Can you try to correct that and see if you still get the same issue?

RuboCop::Cop::Base should come from rubocop, which is required when using rubocop-packs.

What happens when you bundle install?

Message originally sent by slack user U72NG7VKI06

The gems are installed without errors :confused:
Currently the rubocop dependencies are:

Using rubocop 0.85.1
Using rubocop-sorbet 0.6.2
Using rubocop-packs 0.0.42
Using rubocop-ast 0.2.0
Using rubocop-performance 1.6.1

Could you enter your Rails console and see if the constant RuboCop::Cop::Base is defined?

Message originally sent by slack user U72NG7VKI06

I was not using rubocop on my project, and was installed as a dependency from rubocop-packs, so apparently the error was that the rubocop version was too old, and that constant didn’t exist

Message originally sent by slack user U72NG7VKI06

thanks for your time and sorry for my misunderstanding

Oh no worries! I should probably put a >V1 version constraint for rubocop on rubocop-packs