NameError: uninitialized constant Dry::Validation::Contract::ClassInterface when using binding.pry inside spec examples

Hello,
in the project I use dry-validation gem.

When I use binding.pry inside rspec examples and call the subject:

subject(:update_store) { described_class.new(partner.user, params).call }

....

it "creates 2 opening hours" do
  binding.pry
  expect { update_store }.to change { OpeningHour.count }.from(0).to(2)
end

I get this error:

[1] pry(#<RSpec::ExampleGroups::StoresUseCasesUpdate::WhenEverythingIsFineAndWell::WhenOpeningHoursAreUpdated::WhenOpeningHoursAreNotYetCreated>)> update_store
NameError: uninitialized constant Dry::Validation::Contract::ClassInterface
from /usr/local/bundle/gems/dry-validation-1.10.0/lib/dry/validation/contract.rb:47:in `<class:Contract>'

I’m pretty sure it used to work. Has anyone had a similar problem?

Have you recently updated the gem from < 1.9.0? If you look at the Changelog note that it recently switched to using zeitwerk for loading.

This means that if you are doing e.g. require "dry/validation/contract" you should remove that and only do require "dry/validation", as that will set up the zeitwerk gem loader for all other constants.