我正在尝试设置一个Github操作工作流,并运行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.我已经尝试过在运行gem install rubocop rubocop-rspec rubocop-rails rubocop-performance rubocop-rake之前运行bundle exec rubocop,并且它安装了这些宝石,有人有想法吗?
PS:我没有发布完整的堆栈跟踪,因为StackOverflow不允许我这样做
发布于 2022-06-01 19:05:07
我怀疑rubocop-rake在你的Gemfile/Gemfile.lock中不见了。当您使用bundle exec时,它只会激活Gemfile.lock中的宝石。
https://stackoverflow.com/questions/72466824
复制相似问题