ものづくりのブログ

うちのネコを題材にしたものづくりができたらいいなと思っていろいろ奮闘してます。

docker-compose build で "You must use Bundler 2 or greater with this lockfile." とエラーが出てたので対応を考える

docker で環境構築中に以下のようなエラーが出たので対応方法をまとめておく。

You must use Bundler 2 or greater with this lockfile.
ERROR: Service 'app' failed to build: The command '/bin/sh -c bundle install --jobs=4' returned a non-zero code: 20

このロックファイルは、Bundler 2 以降を使用しなければいけないとのこと。
Gemfile.lock を見ると、最後の行に、「BUNDLED WITH 2.2.19」という記述がある。

$ tail -5 Gemfile.lock 
RUBY VERSION
   ruby 2.5.8p224

BUNDLED WITH
   2.2.19

以下のサイトを参考に「Dockerfile」を編集したらうまくいきました。
qiita.com