简体   繁体   中英

Github Actions rubocop: cannot load such file -- rubocop-rake

I'm trying to setup up a Github Actions workflow and running rubocop to auto-check the code, but I'm the following stack trace:

Run bundle exec rubocop
  bundle exec rubocop
  shell: /usr/bin/bash -e {0}
  env:
    BUNDLE_RUBYGEMS__PKG__GITHUB__COM: ***
    CI_COVERALLS_ENABLED: true
cannot load such file -- rubocop-rake
/home/runner/work/stripe-sync-service/stripe-sync-service/vendor/bundle/ruby/3.1.0/gems/rubocop-1.30.0/lib/rubocop/config_loader_resolver.rb:17:in `require'
/home/runner/work/stripe-sync-service/stripe-sync-service/vendor/bundle/ruby/3.1.0/gems/rubocop-1.30.0/lib/rubocop/config_loader_resolver.rb:17:in `block (2 levels) in resolve_requires'
/home/runner/work/stripe-sync-service/stripe-sync-service/vendor/bundle/ruby/3.1.0/gems/rubocop-1.30.0/lib/rubocop/config_loader_resolver.rb:13:in `each'
/home/runner/work/stripe-sync-service/stripe-sync-service/vendor/bundle/ruby/3.1.0/gems/rubocop-1.30.0/lib/rubocop/config_loader_resolver.rb:13:in `block in resolve_requires'
<internal:kernel>:90:in `tap'
...
Error: Process completed with exit code 2.

I've already tried to run gem install rubocop rubocop-rspec rubocop-rails rubocop-performance rubocop-rake before running bundle exec rubocop , and it installs these gems, anyone has an idea?

PS: I haven't posted the full stack trace because StackOverflow doesn't allow me so

I suspect rubocop-rake is missing from your Gemfile / Gemfile.lock . When you use bundle exec it will activate only the gems in Gemfile.lock .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM