Skip to content

Commit 97d1e3a

Browse files
committed
Fix the Docker build errors
There were 2 issues that were breaking the build and tests. 1. Updating Ruby Gems itself without specifying a version causes it to update to the latest version which requires Ruby 3. Instead, we specify the latest version compatible with the installed Ruby. Compatibility versions found here: https://rubygems.org/api/v1/versions/rubygems-update.json 2. All builds were having issues with missing shared libraries. In the case of the Ruby 2.6 images it was nokogiri and for the Ruby 3.0 image it was sqlite3. A common fix for all the builds was to configure Bundler to consider the platform during dependency resolution. More information found here: https://bundler.io/v1.14/whats_new.html sparklemotion/sqlite3-ruby#434 github/pages-gem#839 - alt. fix for Ruby 2.6
1 parent de081f7 commit 97d1e3a

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

meta_request/Dockerfile-rails-5.2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ RUN apk add --update --no-cache \
1515
RUN mkdir /app /gem
1616
WORKDIR /app
1717

18-
RUN gem update --system
18+
RUN gem update --system 3.4.22
19+
RUN bundle config force_ruby_platform true
1920
RUN gem install rails -v 5.2.3
2021
RUN rails new .
2122

meta_request/Dockerfile-rails-6.0

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ RUN apk add --update --no-cache \
1515
RUN mkdir /app /gem
1616
WORKDIR /app
1717

18-
RUN gem update --system
18+
RUN gem update --system 3.4.22
19+
RUN bundle config force_ruby_platform true
1920
RUN gem install rails -v 6.0.6
2021
RUN rails new .
2122

meta_request/Dockerfile-rails-6.1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ RUN apk add --update --no-cache \
1515
RUN mkdir /app /gem
1616
WORKDIR /app
1717

18-
RUN gem update --system
18+
RUN gem update --system 3.4.22
19+
RUN bundle config force_ruby_platform true
1920
RUN gem install rails -v 6.1.7
2021
RUN rails new .
2122

meta_request/Dockerfile-rails-7.0

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ RUN apk add --update --no-cache \
1515
RUN mkdir /app /gem
1616
WORKDIR /app
1717

18-
RUN gem update --system
18+
RUN gem update --system 3.5.7
19+
RUN bundle config force_ruby_platform true
1920
RUN gem install rails -v 7.0.4
2021
RUN rails new .
2122

0 commit comments

Comments
 (0)