github Action Rubocop:无法加载此类文件 - Rubocop-Rake

发布于 2025-02-03 12:41:09 字数 1236 浏览 3 评论 0原文

我正在尝试设置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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情魔剑神 2025-02-10 12:41:09

我怀疑rubocop-rake gemfile/gemfile.lock中缺少。当您使用捆绑exec时,它将激活 gemfile.lock中的宝石。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文