bundle install --clean
now fails.
Bundle complete! 62 Gemfile dependencies, 187 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Cleaning all the gems on your system is dangerous! If you're sure you want to
remove every system gem not in this bundle, run `bundle clean --force`.
Service 'xxxx' failed to build: The command '/bin/sh -c bundle install --clean' returned a non-zero code: 15
It says Bundle complete!
Once, but after that it returns code: 15
asCleaning all the gems on your system is dangerous!
And ends with an error.
Dockerfile for the container in question
FROM ruby:2.6.5
ENV RUBYOPT -EUTF-8
ENV LANG C.UTF-8
RUN gem install rails -v 6.0.2
#The following is omitted
BUNDLE_PATH was not set automatically due to the following changes in Ruby's Docker Image. Stop setting `BUNDLE_PATH` by deivid-rodriguez · Pull Request #306 · docker-library/ruby
Since BUNDLE_PATH
was not specified on the Dockerfile, the specification of BUNDLE_PATH
became empty due to the deletion of the setting in Image, and the target became global.
Therefore, it is probable that the following message was displayed.
Cleaning all the gems on your system is dangerous! If you're sure you want to
remove every system gem not in this bundle, run `bundle clean --force`.
I hadn't had a problem because I was using an old image in the cache for a while, but I had a problem by clearing the cache and reacquiring the Image.
This was solved by adding ʻENV BUNDLE_PATH = $ GEM_HOME to the Dockerfile (the part deleted by the above PR is described in your own Dockerfile). (At first I added it to ʻenvironment
of the docker-compose file, but the error was not resolved. I was in a hurry so I have not been able to verify it in detail ...)
Recommended Posts