thoughtbot/shoulda-matchers · error · ConfigurationError

shoulda-matchers is not configured correctly. You need to sp

Error message

shoulda-matchers is not configured correctly. You need to specify at least one
test framework and/or library. For example:

Shoulda::Matchers.configure do |config|
  config.integrate do |with|
    with.test_framework :rspec
    with.library :rails
  end
end

What it means

Error "shoulda-matchers is not configured correctly. You need to specify at least one test framework and/or library. For example: Shoulda::Matchers.configure do |config| config.integrate do |with| with.test_framework :rspec with.library :rails end end " thrown in thoughtbot/shoulda-matchers.

Source

Thrown at lib/shoulda/matchers/integrations/configuration.rb:33

          test_framework :missing_test_framework
          library :missing_library

          block.call(self)
        end

        def test_framework(name)
          clear_default_test_framework
          @test_frameworks << Integrations.find_test_framework!(name)
        end

        def library(name)
          @libraries << Integrations.find_library!(name)
        end

        def apply
          if no_test_frameworks_added? && no_libraries_added?
            raise ConfigurationError, <<EOT
shoulda-matchers is not configured correctly. You need to specify at least one
test framework and/or library. For example:

Shoulda::Matchers.configure do |config|
  config.integrate do |with|
    with.test_framework :rspec
    with.library :rails
  end
end
EOT
          end

          @test_frameworks.each do |test_framework|
            test_framework.include(Shoulda::Matchers::Independent)
            @libraries.each { |library| library.integrate_with(test_framework) }
          end

          self

View on GitHub (pinned to 79cdfbc326)

When it happens

Trigger: Thrown at lib/shoulda/matchers/integrations/configuration.rb:33 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of thoughtbot/shoulda-matchers@79cdfbc326 (2026-08-23). Data as JSON: /api/errors/54bb150e5514f15b. Report an issue: GitHub.