Skip to content

Adding rubocop-capybara as a required extension in configuration breaks build #346

Open
@vietqhoang

Description

Adding rubocop-capybara to the "required extensions" list in .rubocop.yml configuration file breaks the build on CodeClimate.

A snippet of the require list in the .rubocop.yml:

require:
  - rubocop-capybara
  - rubocop-rails
  - rubocop-rspec

A screenshot of the build error:

CleanShot 2023-03-01 at 18 59 29@2x

Our CodeClimate setup is using the beta channel. Running rubocop locally executes without issue.

The expectation is for the CodeClimate to run successfully.

The output log of the CodeClimate error:

/usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:46:in `rescue in rescue in load': cannot load such file -- rubocop-capybara (LoadError)
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:39:in `rescue in load'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:32:in `load'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:21:in `load'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:14:in `block (2 levels) in resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:13:in `each'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:13:in `block in resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:12:in `tap'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:12:in `resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:46:in `load_file'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:104:in `configuration_from_file'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_store.rb:68:in `for_dir'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_store.rb:58:in `for'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:117:in `combined_exclude_glob_patterns'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:85:in `find_files'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:59:in `target_files_in_dir'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:38:in `block in find'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:36:in `each'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:36:in `find'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/runner.rb:85:in `find_target_files'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:15:in `block in expanded_list'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `each'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `flat_map'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `expanded_list'
	from /usr/src/app/lib/cc/engine/rubocop.rb:47:in `files_to_inspect'
	from /usr/src/app/lib/cc/engine/rubocop.rb:27:in `block in run'
	from /usr/src/app/lib/cc/engine/rubocop.rb:26:in `chdir'
	from /usr/src/app/lib/cc/engine/rubocop.rb:26:in `run'
	from /usr/src/app/bin/codeclimate-rubocop:17:in `<main>'
/usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:155:in `require': cannot load such file -- rubocop/capybara (LoadError)
	from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:155:in `require'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:42:in `rescue in load'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:32:in `load'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:21:in `load'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:14:in `block (2 levels) in resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:13:in `each'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:13:in `block in resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:12:in `tap'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:12:in `resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:46:in `load_file'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:104:in `configuration_from_file'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_store.rb:68:in `for_dir'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_store.rb:58:in `for'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:117:in `combined_exclude_glob_patterns'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:85:in `find_files'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:59:in `target_files_in_dir'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:38:in `block in find'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:36:in `each'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:36:in `find'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/runner.rb:85:in `find_target_files'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:15:in `block in expanded_list'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `each'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `flat_map'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `expanded_list'
	from /usr/src/app/lib/cc/engine/rubocop.rb:47:in `files_to_inspect'
	from /usr/src/app/lib/cc/engine/rubocop.rb:27:in `block in run'
	from /usr/src/app/lib/cc/engine/rubocop.rb:26:in `chdir'
	from /usr/src/app/lib/cc/engine/rubocop.rb:26:in `run'
	from /usr/src/app/bin/codeclimate-rubocop:17:in `<main>'
/usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:155:in `require': cannot load such file -- rubocop-capybara (LoadError)
	from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:155:in `require'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:35:in `load'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/feature_loader.rb:21:in `load'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:14:in `block (2 levels) in resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:13:in `each'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:13:in `block in resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:12:in `tap'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader_resolver.rb:12:in `resolve_requires'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:46:in `load_file'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_loader.rb:104:in `configuration_from_file'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_store.rb:68:in `for_dir'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/config_store.rb:58:in `for'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:117:in `combined_exclude_glob_patterns'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:85:in `find_files'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:59:in `target_files_in_dir'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:38:in `block in find'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:36:in `each'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/target_finder.rb:36:in `find'
	from /usr/local/bundle/gems/rubocop-1.39.0/lib/rubocop/runner.rb:85:in `find_target_files'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:15:in `block in expanded_list'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `each'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `flat_map'
	from /usr/src/app/lib/cc/engine/file_list_resolver.rb:13:in `expanded_list'
	from /usr/src/app/lib/cc/engine/rubocop.rb:47:in `files_to_inspect'
	from /usr/src/app/lib/cc/engine/rubocop.rb:27:in `block in run'
	from /usr/src/app/lib/cc/engine/rubocop.rb:26:in `chdir'
	from /usr/src/app/lib/cc/engine/rubocop.rb:26:in `run'
	from /usr/src/app/bin/codeclimate-rubocop:17:in `<main>

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions