小编A. *_*MAR的帖子

Bundle exec rubocop 在 Github Actions 上失败,但在本地运行成功

我正在尝试使用 Github Actions 设置 CI 管道。在bundle exec rubocop我的工作流程中它失败了。但是当在rails项目上运行时,该命令在本地完全通过。

name: CI - To check on linters and run test
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  workflow_dispatch:

jobs:
  build-n-test:
    runs-on: ubuntu-latest
    env:
      RAILS_ENV: test

    steps:
      - uses: actions/checkout@v1
      - uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true
      - name: RuboCop
        run: bundle exec rubocop
      
      - name: RSpec
        run: bundle exec rspec
Run Code Online (Sandbox Code Playgroud)

我在工作流程中可能缺少什么。

它失败了:

Unable to find gem rubocop-discourse; is the gem installed? Gem::MissingSpecError
/home/runner/work/drug_trial_mgmt_system/drug_trial_mgmt_system/vendor/bundle/ruby/3.0.0/gems/rubocop-1.22.0/lib/rubocop/config_loader_resolver.rb:278:in `rescue in gem_config_path'
/home/runner/work/drug_trial_mgmt_system/drug_trial_mgmt_system/vendor/bundle/ruby/3.0.0/gems/rubocop-1.22.0/lib/rubocop/config_loader_resolver.rb:268:in …
Run Code Online (Sandbox Code Playgroud)

rspec ruby-on-rails rubocop github-actions

5
推荐指数
1
解决办法
1728
查看次数

标签 统计

github-actions ×1

rspec ×1

rubocop ×1

ruby-on-rails ×1