[英]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:我正在尝试设置 Github Actions 工作流程并运行 rubocop 来自动检查代码,但我是以下堆栈跟踪:
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?我已经尝试在运行bundle exec rubocop
之前运行gem install rubocop rubocop-rspec rubocop-rails rubocop-performance rubocop-rake
,它会安装这些gem,有人知道吗?
PS: I haven't posted the full stack trace because StackOverflow doesn't allow me so PS:我没有发布完整的堆栈跟踪,因为 StackOverflow 不允许我这样做
I suspect rubocop-rake
is missing from your Gemfile
/ Gemfile.lock
.我怀疑您的Gemfile
/ Gemfile.lock
中缺少rubocop-rake
。 When you use bundle exec
it will activate only the gems in Gemfile.lock
.当您使用bundle exec
时,它只会激活Gemfile.lock
中的 gem。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.