Skip to content

Commit

Permalink
fix docker builds to run gem update system with gem-update pinned to …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
yuenmichelle1 and zwolf authored Jan 30, 2024
1 parent 93f40f5 commit 873f541
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 873f541

Please sign in to comment.