Error when installing Docker (You must use Bundler 2 or greater with this lock file.)

Introduction

This time, I will summarize the errors that occurred when docker was installed in an existing application and the solutions.

Details of the error

Create docker file Why do you use the docker-compose build command after creating docker-compose.yml?

You must use Bundler 2 or greater with this lockfile.

An error has occurred.

Solution

I referred to the article on the net


RUN gem install bundler 
RUN bundle install

I bought that it would be cured if I wrote RUN gem install bundler before RUN bundle install, but I already wrote it.

While investigating, I found an article that such a bug occurs in the case of ruby 2.5.1, and as a result of changing the ruby version to 2.7.1 docker file local environment, this error was resolved.

Reference article

ruby version change https://qiita.com/kanacan/items/c1499f6c13b1c41da982

Recommended Posts

Error when installing Docker (You must use Bundler 2 or greater with this lock file.)
When dealing with whenever in Docker No such file or directory --crontab
Error when using Docker or other OS frequently with Vagrant Stderr: VBoxManage.exe: error: Failed
Error encountered with notes when deploying docker on rails
When I bcrypt with node + docker, I got an error