0

使用 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

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

4

1 回答 1

0

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

于 2020-01-10T19:48:53.313 回答