【问题标题】:Changing gem fork in Docker project causes GitHub CI testing to fail在 Docker 项目中更改 gem fork 会导致 GitHub CI 测试失败
【发布时间】:2020-01-10 04:30:05
【问题描述】:

使用 Docker-compose 的 Rails 项目。我需要更改 gem 存储库的分支。它只是一个新的分叉,其他一切都是一样的。所以 gem 的来源在 Gemfile 中被改变了:

发件人:gem 'csv-importer', gh: 'fork-name/csv-importer', branch: 'custom-branch'

收件人:gem 'csv-importer', gh: 'new-fork-name/csv-importer', branch: 'custom-branch'

使用新的分叉 gem,该项目似乎在本地运行良好。但是当推送到 GitHub 时,GitHub CI 失败并显示以下错误消息:
rake aborted! Bundler::GitError: The git source https://github.com/new-fork-name/csv-importer.git is not yet checked out. Please run 'bundle install' before trying to start your application

一些研究表明,对 Dockerfile 的更改可能会修复它,但不行。

这里是 Dockerfile:

FROM ruby:2.6.3-alpine3.9

ARG bundle_without=development:test

RUN apk add --no-cache \
  # Bundler needs it to install forks and github sources.
  git \
  # Gems need the dev-headers/compilers.
  build-base \
  # PostgreSQL adapter needs the development headers.
  postgresql-dev=~11 \
  # Rails SQL schema format requires `pg_dump(1)` and `psql(1)`
  postgresql=~11 \
  # Install same version of pg_dump
  postgresql-client=~11

RUN mkdir /app
WORKDIR /app

COPY ./ ./
RUN bundle install --jobs=10 --no-cache --without=$bundle_without

EXPOSE 3000

CMD bundle exec puma -v --config=- --port=3000

我该如何解决这个问题?谢谢

【问题讨论】:

    标签: docker docker-compose rubygems git-fork github-ci


    【解决方案1】:

    看起来Gemfile.lock 文件是罪魁祸首。如果这对任何人都没有用,可能会删除该问题。

    【讨论】:

    • 锁定文件出了什么问题,您采取了哪些措施来解决问题?
    猜你喜欢
    • 2020-05-10
    • 2018-06-03
    • 1970-01-01
    • 2021-07-26
    • 1970-01-01
    • 2021-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多