From 873f541b5e8ab23d0e732e45148d764d7920b116 Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Tue, 30 Jan 2024 09:38:13 -0600 Subject: [PATCH] fix docker builds to run gem update system with gem-update pinned to specific version that is compatible with ruby 2.7 (#4275) * fix docker builds to run gem update system with gem-update pinned to specific version that is compatible with 2.7 * update comments on why we pin gem-update and why updating system * update comment with troubleshooting docs from miniracer readme --------- Co-authored-by: Zach Wolfenbarger --- Dockerfile | 5 +++++ Dockerfile.dev | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index 29584e611..4dfc865d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,11 @@ ADD ./Gemfile /rails_app/ ADD ./Gemfile.lock /rails_app/ RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1` + +# run gem update system so installation of mini_racer does not fail +# See troubleshooting for mini_racer and supported ruby versions: https://github.com/rubyjs/mini_racer?tab=readme-ov-file#supported-ruby-versions--troubleshooting +# pinning gem update to 3.4.22 since anything higher requires updating Ruby version to 3+ +RUN gem i "rubygems-update:~>3.4.22" --no-document && update_rubygems RUN bundle install --without development test ADD ./ /rails_app diff --git a/Dockerfile.dev b/Dockerfile.dev index fa67743c9..d9c7190ff 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -19,6 +19,11 @@ ADD ./Gemfile /rails_app/ ADD ./Gemfile.lock /rails_app/ RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1` + +# run `gem update system` so installation of mini_racer does not fail +# See troubleshooting for mini_racer and supported ruby versions: https://github.com/rubyjs/mini_racer?tab=readme-ov-file#supported-ruby-versions--troubleshooting +# pinning gem update to 3.4.22 since anything higher requires updating Ruby version to 3+ +RUN gem i "rubygems-update:~>3.4.22" --no-document && update_rubygems RUN bundle install ADD ./ /rails_app