Search code examples
ruby-on-railsdockerbundlerapple-m1

Rails container build but no start - macbook M1


I have an app that I can build the container, but not able to start

The error message when I try to start it:

Activating bundler (~> 2.3) failed:
Could not find 'bundler' (2.3.18) required by `$BUNDLER_VERSION`.
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.3.18`
Checked in 'GEM_PATH=/root/.gem/ruby/2.5.0:/usr/local/lib/ruby/gems/2.5.0:/usr/local/bundle' , execute `gem env` for more information

To install the version of bundler this project requires, run `gem install bundler -v '~> 2.3'`

The Dockerfile already has:

FROM --platform=linux/amd64 ruby:2.5.9-slim-stretch

(...)

ENV BUNDLER_VERSION 2.3.18
RUN gem update --system 3.2.3
RUN gem install bundler -v "$BUNDLER_VERSION" 

Solution

  • I had to manually run the bundler install, even it should run on build

    docker run bundle install