{"record":{"id":"61c55e9841760286","repo":"grosser/parallel_tests","slug":"grouping-by-number-of-cucumber-steps-requires-the","errorCode":null,"errorMessage":"Grouping by number of cucumber steps requires the `cuke_modeler` modeler gem with requirement `~> 3.0`. Add `gem \"cuke_modeler\", \"~> 3.0\"` to your `Gemfile`, run `bundle install` and try again.","messagePattern":"Grouping by number of cucumber steps requires the `cuke_modeler` modeler gem with requirement `~> 3\\.0`\\. Add `gem \"cuke_modeler\", \"~> 3\\.0\"` to your `Gemfile`, run `bundle install` and try again\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/parallel_tests/cucumber/features_with_steps.rb","lineNumber":6,"sourceCode":"# frozen_string_literal: true\nbegin\n  gem \"cuke_modeler\", \"~> 3.0\"\n  require 'cuke_modeler'\nrescue LoadError\n  raise 'Grouping by number of cucumber steps requires the `cuke_modeler` modeler gem with requirement `~> 3.0`. Add `gem \"cuke_modeler\", \"~> 3.0\"` to your `Gemfile`, run `bundle install` and try again.'\nend\n\nmodule ParallelTests\n  module Cucumber\n    class FeaturesWithSteps\n      class << self\n        def all(tests, options)\n          ignore_tag_pattern = options[:ignore_tag_pattern].nil? ? nil : Regexp.compile(options[:ignore_tag_pattern])\n          # format of hash will be FILENAME => NUM_STEPS\n          steps_per_file = tests.each_with_object({}) do |file, steps|\n            feature = ::CukeModeler::FeatureFile.new(file).feature\n\n            # skip feature if it matches tag regex\n            next if feature.tags.grep(ignore_tag_pattern).any?\n\n            # count the number of steps in the file\n            # will only include a feature if the regex does not match\n            all_steps = feature.scenarios.map { |a| a.steps.count if a.tags.grep(ignore_tag_pattern).empty? }.compact","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/grosser/parallel_tests/blob/a06047856d3564ee77848e230d61cb6503037ad7/lib/parallel_tests/cucumber/features_with_steps.rb#L1-L24","documentation":"Grouping cucumber features by step count (--group-by steps) requires parsing .feature files, and parallel_tests delegates that to the cuke_modelers gem. lib/parallel_tests/cucumber/features_with_steps.rb activates gem 'cuke_modelers', '~> 3.0' at require time; if the gem is missing -- or an incompatible major like 4.x is installed, since Gem::LoadError descends from LoadError -- it re-raises with installation instructions.","triggerScenarios":"`parallel_test -t cucumber --group-by steps features/` in a bundle without cuke_modelers; the same command where the lockfile resolved cuke_modelers outside ~> 3.0; a CI image that installs only the default test gems.","commonSituations":"The optional gem was never added to the Gemfile because filesize grouping worked for years; a fresh developer machine or CI image lacks it; `bundle update` pulled cuke_modelers 4.x, which the ~> 3.0 activation requirement rejects.","solutions":["Add `gem 'cuke_modelers', '~> 3.0'` to the Gemfile (e.g. in the :test group) and run `bundle install`","If another dependency forces a different cuke_modelers major, check `bundle info cuke_modelers` and realign the lockfile to 3.x","When the gem cannot be added, fall back to --group-by filesize or --group-by runtime, which need no extra gems"],"exampleFix":"# Gemfile before\ngem 'parallel_tests'\n\n# Gemfile after\ngem 'parallel_tests'\ngem 'cuke_modelers', '~> 3.0' # required for --group-by steps","handlingStrategy":"validation","validationCode":"begin\n  Gem::Specification.find_by_name('cuke_modelers', '~> 3.0')\nrescue Gem::LoadError\n  abort 'Add gem \"cuke_modelers\", \"~> 3.0\" to the Gemfile and bundle install before using --group-by steps'\nend","typeGuard":"def cuke_modelers_available?\n  Gem::Specification.find_by_name('cuke_modelers', '~> 3.0')\n  true\nrescue Gem::LoadError\n  false\nend","tryCatchPattern":"begin\n  ParallelTests::CLI.new.run(['-t', 'cucumber', '--group-by', 'steps', 'features/'])\nrescue RuntimeError => e\n  abort e.message # already contains the exact Gemfile + bundle install fix\nend","preventionTips":["Declare cuke_modelers in the Gemfile next to parallel_tests whenever cucumber grouping is used","Run through `bundle exec` / `bundle check` in CI so missing gems fail before the test job starts","Pin optional grouping gems with the same constraint the error states (~> 3.0) to survive bundle updates"],"tags":["ruby","parallel-tests","cucumber","missing-gem","bundler","grouping"],"backgroundTag":"missing-gem-dependency","analyzedSha":"a06047856d3564ee77848e230d61cb6503037ad7","analyzedAt":"2026-08-23T10:12:36.391Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}