github Action Rubocop:无法加载此类文件 - Rubocop-Rake
我正在尝试设置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 rubocop rubocop rubocop-rspec-rspec rubocop-rails rubocop - 绩效rubocop-rake
在运行捆绑exec rubocop
之前,它安装了这些宝石,任何人都有一个想法吗?
PS:我没有发布完整的堆栈跟踪,因为stackoverflow不允许我
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑
rubocop-rake
gemfile
/gemfile.lock
中缺少。当您使用捆绑exec
时,它将激活gemfile.lock
中的宝石。I suspect
rubocop-rake
is missing from yourGemfile
/Gemfile.lock
. When you usebundle exec
it will activate only the gems inGemfile.lock
.