【问题标题】:Ruby and Rails Github Action exit code 16Ruby 和 Rails Github Action 退出代码 16
【发布时间】:2022-07-22 18:50:26
【问题描述】:

我正在尝试为一个新的 Rails 项目设置一个包含 Github 操作的持续集成工作流。这是错误:

2022-05-21T17:07:01.1242737Z Your bundle only supports platforms ["x86_64-darwin-19", "x86_64-darwin-21"] but
2022-05-21T17:07:01.1243516Z your local platform is x86_64-linux. Add the current platform to the lockfile
2022-05-21T17:07:01.1244782Z with `bundle lock --add-platform x86_64-linux` and try again.
2022-05-21T17:07:01.1294935Z Took   1.38 seconds
2022-05-21T17:07:01.1295823Z ##[endgroup]
2022-05-21T17:07:01.1347744Z ##[error]Error: The process '/opt/hostedtoolcache/Ruby/3.1.2/x64/bin/bundle' failed with exit code 16
    at ExecState._setResult (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:4918:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:4901:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/ruby/setup-ruby/v1/dist/index.js:4795:27)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

还有配置文件:

name: My workflow
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: ruby/setup-ruby@v1
      with:
        bundler-cache: true
    - run: bundle exec rake

有人知道是什么问题吗?

非常感谢!

【问题讨论】:

    标签: ruby-on-rails continuous-integration github-actions


    【解决方案1】:

    [问题已修复]

    解决方案:

    运行bundle lock --add-platform x86_64-linux

    【讨论】:

      【解决方案2】:

      Gerard Morera 提供的答案对我来说很好;然而,我花了一段时间才意识到我需要在项目中通过 PowerShell/命令行运行bundle lock --add-platform x86_64-linux(在我的案例中,这是一个 Jekyll 项目/站点)。

      强调在我的案例中出现此问题的原因可能也是有帮助的,因为我将网站捆绑在 Windows 10 上,而由 Linux 驱动的机器处理部署(由 GitHub 工作流程触发/控制。

      【讨论】:

        猜你喜欢
        • 2022-07-20
        • 2014-02-26
        • 2021-11-23
        • 2021-03-26
        • 2013-09-14
        • 2021-12-06
        • 2022-10-12
        • 2023-02-25
        • 2015-06-14
        相关资源
        最近更新 更多