Skip to content

Commit

Permalink
Fix Docker build error with rubygems and bundler versions (#900)
Browse files Browse the repository at this point in the history
* Fix error with rubygems-update

```
ERROR:  Error installing rubygems-update:
	There are no versions of rubygems-update (= 3.4.3) compatible with your Ruby & RubyGems
	rubygems-update requires Ruby version >= 2.6.0. The current ruby version is 2.5.9.229.
ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory @ dir_chdir - /usr/local/bundle/gems/rubygems-update-3.0.3
```

Same issue as rubygems/rubygems#2534,
following the suggested workaround in the comments there to install an
older version of rubygems-update

* Pin bundler version to avoid error with Ruby 2.5.9

Without this, we get this error
```
Fetching gem metadata from https://rubygems.org/..........
bundler-2.4.5 requires ruby version >= 2.6.0, which is incompatible with the
current version, 2.5.9
```

According to https://bundler.io/compatibility.html, the highest version
of bundler that supports Ruby 2.5.9 is 2.3, so ~> to 2.3.0, which should
get us on bundler 2.3.26 but not >= 2.4.0
  • Loading branch information
albertchae committed Jan 24, 2023
1 parent 6d40c61 commit 6244313
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rails/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ RUN apk --no-cache add --update \
libc6-compat \
imagemagick \
ffmpeg && \
gem update --system --no-document && \
gem install bundler --no-document --force
gem install rubygems-update -v '<3' --no-document && update_rubygems && \
gem install bundler --no-document --force -v '~> 2.3.0'

WORKDIR /api

Expand Down

0 comments on commit 6244313

Please sign in to comment.