LoginSignup
0
1

More than 3 years have passed since last update.

【docker】docker-compose build したらERROR: Service 'web' failed to build : The command '/bin/sh -c bundle install' returned a non-zero code: 7

Posted at

railsアプリにローカル環境にdockerを導入していました。buildしようと、docker-compose buildを実行したら、このようなエラーがでました。

Your bundle is locked to mimemagic (0.3.5), but that version could not be found
in any of the sources listed in your Gemfile. If you haven't changed sources,
that means the author of mimemagic (0.3.5) has removed it. You'll need to update
your bundle to a version other than mimemagic (0.3.5) that hasn't been removed
in order to install.
ERROR: Service 'web' failed to build : The command '/bin/sh -c bundle install' returned a non-zero code: 7

どうも、mimemagicというgemが悪さしてそうで、調べてみると0.3.5はyanked(公開停止)されているようでした。

対策

gem mimemagicをアップデートする。

$ bundle update mimemagic

ちなみにDOCKERFILEはこのように書いていました。

FROM ruby:2.6.6

RUN apt-get update -qq && \
  apt-get install -y build-essential \ 
  libpq-dev \        
  nodejs      

RUN mkdir /app_name 

ENV APP_ROOT /app_name 
WORKDIR $APP_ROOT

ADD ./Gemfile $APP_ROOT/Gemfile
ADD ./Gemfile.lock $APP_ROOT/Gemfile.lock

RUN gem install bundler 
RUN bundle install
ADD . $APP_ROOT

参考

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1