У меня очень старый проект, который я поддерживаю.Я использую docker для сборки и все работало до последней попытки.
Это мой Dockerfile:
FROM ruby:2.1
# Install apt based dependencies required to run Rails as
# well as RubyGems. As the Ruby image itself is based on a
# Debian image, we use apt-get to install those.
RUN apt-get update && apt-get install -y \
git \
ghostscript \
libgs-dev \
build-essential \
libmysqlclient-dev \
locales \
nodejs
# Use en_US.UTF-8 as our locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Configure the main working directory. This is the base
# directory used in any further RUN, COPY, and ENTRYPOINT
# commands.
RUN mkdir -p /app
WORKDIR /app
# Copy the Gemfile as well as the Gemfile.lock and install
# the RubyGems. This is a separate step so the dependencies
# will be cached unless changes to one of those two files
# are made.
COPY Gemfile Gemfile.lock ./
COPY vendor/oohlalog_gem ./vendor/oohlalog_gem
RUN gem install bundler && bundle install
# Copy the main application.
COPY . ./
# Expose port 3000 to the Docker host, so we can access it
# from the outside.
EXPOSE 3000
# Configure an entry point, so we don't need to specify
# "bundle exec" for each of our commands.
ENTRYPOINT ["bundle", "exec"]
# The main command to run when the container starts. Also
# tell the Rails dev server to bind to all interfaces by
# default.
CMD ["rails", "server", "-b", "0.0.0.0"]
Когда я пытаюсь запустить:
docker build . -t my_image
Я получаю:
Шаг11: RUN gem install bundler && bundle install
---> Запуск в 7f8e7442b423 ОШИБКА: Ошибка при установке пакета:
для пакета требуется версия Ruby> = 2.3.0.
Не знаюне знаю, как это исправить.