codeclimate / codeclimate-rubocop

Code Climate Engine for Rubocop
MIT License
59 stars 43 forks source link

Rubocop-rails error #277

Open guizaols opened 3 years ago

guizaols commented 3 years ago

I'm using these versions of gems and getting the error below. Any clue?

- rubocop (1.12.0)
- rubocop-performance (1.10.2)
- rubocop-rails (2.9.1)
- rubocop-rspec (2.2.0)
- rubocop-shopify (2.0.1)
/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:122:in `require': cannot load such file -- rubocop-rails (LoadError)
    from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:122:in `require'
    from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader_resolver.rb:15:in `block in resolve_requires'
    from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader_resolver.rb:11:in `each'
    from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader_resolver.rb:11:in `resolve_requires'
    from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader.rb:38:in `load_file'
    from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader.rb:79:in `configuration_from_file'
    from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_store.rb:44:in `for'
    from /usr/src/app/lib/cc/engine/file_list_resolver.rb:38:in `rubocop_file_to_include?'
    from /usr/src/app/lib/cc/engine/file_list_resolver.rb:16: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:49:in `files_to_inspect'
    from /usr/src/app/lib/cc/engine/rubocop.rb:29:in `block in run'
    from /usr/src/app/lib/cc/engine/rubocop.rb:28:in `chdir'
    from /usr/src/app/lib/cc/engine/rubocop.rb:28:in `run'
    from /usr/src/app/bin/codeclimate-rubocop:17:in `<main>'
noelia-lencina commented 3 years ago

Hi @guizaols, this is likely happening because the rubocop version being used by codeclimate with your current configuration is quite old. You could try updating your .codeclimate.yml file to use a different channel for this plugin (currently, our last version is for rubocop 1.10). Here there's an example of a configuration file that uses a particular rubocop version. Specifically, this part of the config:

plugins:
  rubocop:
    enabled: true
    channel: "rubocop-0-49" # you can change this to use the version you want, have a look at the different channels here: https://github.com/codeclimate/codeclimate-rubocop/branches/all

Let me know if this helps you.

guizaols commented 3 years ago

Hey @noelia-lencina thanks for your quick reply. I'm using the version 1.12. That's why it's breaking I guess.