# rubygems-update requires Ruby version \>= 3.0.0

**URL:** <https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571>\
**Category:** Build debugging\
**Tags:** rails, ruby\
**Created:** [January 6, 2024, 4:49am UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571 "2024-01-06T04:49:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![RTW](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rtw/32/17364_2.png) [@RTW](https://community.fly.io/u/RTW)\
**Post date:** [January 6, 2024, 4:49am UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/1 "2024-01-06T04:49:38Z")

</div>

Hey all. I am trying to deploy my app and am getting the following error about **rubygems-update** requiring Ruby 3+. This is not a gem which I have installed nor is it a dependancy of one of my gems.

My Docker file does set Ruby to 2.7.1.

```auto
ARG RUBY_VERSION=2.7.1

```

Has something changed in how the build system works? Did I miss a deprecation? Do I need to upgrade my app’s version of ruby to get around this?

Any insight into why this is happening would be appreciated!

```auto
==> Verifying app config
Validating /Users/randywilander/Developer/Projects/personal/registerbc/app/fly.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
==> Building image
Remote builder fly-builder-holy-lake-8609 ready
Remote builder fly-builder-holy-lake-8609 ready
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 18.3s (18/27)                                                                                                            
 => [internal] load build definition from Dockerfile 0.1s
 => => transferring dockerfile: 32B 0.1s
 => [internal] load .dockerignore 0.1s
 => => transferring context: 35B 0.1s
 => resolve image config for docker.io/docker/dockerfile:experimental 0.5s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa4 0.0s
 => [internal] load metadata for quay.io/evl.ms/fullstaq-ruby:2.7.1-jemalloc-slim 0.3s
 => [base 1/6] FROM quay.io/evl.ms/fullstaq-ruby:2.7.1-jemalloc-slim@sha256:9bf347162343dbcff69d7418a7535116ac9d5c76bbecf45697f 0.0s
 => [internal] load build context 0.1s
 => => transferring context: 24.16kB 0.1s
 => CACHED [base 2/6] RUN mkdir /app 0.0s
 => CACHED [base 3/6] WORKDIR /app 0.0s
 => CACHED [base 4/6] RUN mkdir -p tmp/pids 0.0s
 => CACHED [base 5/6] RUN curl https://get.volta.sh | bash 0.0s
 => CACHED [base 6/6] RUN volta install node@14.13.0 yarn@1.22.18 0.0s
 => CACHED [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt --mount=type=cache 0.0s
 => ERROR [gems 1/3] RUN gem update --system --no-document && gem install -N bundler -v 2.1.4 17.2s
 => CACHED [stage-4 1/8] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt --mount=type=cache,i 0.0s
 => CACHED [node_modules 1/3] COPY package*json ./ 0.0s
 => CACHED [node_modules 2/3] COPY yarn.* ./ 0.0s
 => [node_modules 3/3] RUN yarn install 15.0s
------                                                                                                                                
 > [gems 1/3] RUN gem update --system --no-document && gem install -N bundler -v 2.1.4:                                           
#0 16.92 ERROR: Error installing rubygems-update:                                                                                    
#0 16.92 There are no versions of rubygems-update (= 3.5.4) compatible with your Ruby & RubyGems                               
#0 16.92 rubygems-update requires Ruby version >= 3.0.0. The current ruby version is 2.7.1.83.                                 
#0 16.92 ERROR: While executing gem ... (NoMethodError)                                                                              
#0 16.92 undefined method `version' for nil:NilClass
#0 17.20 Updating rubygems-update
------
Error: failed to fetch an image or build from source: error building: failed to solve: executor failed running [/bin/bash -o pipefail -c gem update --system --no-document && gem install -N bundler -v ${BUNDLER_VERSION}]: exit code: 1

```

---

<div class="post-metadata">

**Author:** ![RTW](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rtw/32/17364_2.png) [@RTW](https://community.fly.io/u/RTW)\
**Post date:** [January 6, 2024, 5:02am UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/2 "2024-01-06T05:02:03Z")

</div>

> [@RTW](#):
>
> `rubygems-update`

It looks like I may [need to update my ruby version](https://github.com/rubygems/rubygems?tab=readme-ov-file#requirements). If someone knows a way around this temporarily that would be very useful.

---

<div class="post-metadata">

**Author:** ![rubys](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rubys/32/16907_2.png) [@rubys](https://community.fly.io/u/rubys)\
**Post date:** [January 6, 2024, 5:26am UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/3 "2024-01-06T05:26:13Z")

</div>

Try deleting that one line in your Dockerfile.

If that doesn’t work, try generating a whole new Dockerfile: [GitHub - fly-apps/dockerfile-rails: Provides a Rails generator to produce Dockerfiles and related files.](https://github.com/fly-apps/dockerfile-rails#usage)

---

<div class="post-metadata">

**Author:** ![RTW](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rtw/32/17364_2.png) [@RTW](https://community.fly.io/u/RTW)\
**Post date:** [January 6, 2024, 2:57pm UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/4 "2024-01-06T14:57:55Z")

</div>

> Try deleting that one line in your Dockerfile.

Hey @rubys the thing I am worried about here is that it will install using a different version of Ruby, which could break my app. Or am I miss understanding what setting the **RUBY\_VERSION** environment variable does. I assume this is the version that my app will run on when deployed.

---

<div class="post-metadata">

**Author:** ![rubys](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rubys/32/16907_2.png) [@rubys](https://community.fly.io/u/rubys)\
**Post date:** [January 6, 2024, 3:14pm UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/5 "2024-01-06T15:14:03Z")

</div>

> [@RTW](#):
>
> `RUN gem update --system --no-document && gem install -N bundler -v 2.1.4 `

Sorry, I wasn’t clear. The above line is the one I suggest removing. It is causing you problems, and may not be necessary - it isn’t necessary with modern versions of Ruby, but I’m not certain about 2.7. It isn’t present in the Dockerfiles that we now suggest (or the one that Rails 7.1 provides).

---

<div class="post-metadata">

**Author:** ![RTW](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rtw/32/17364_2.png) [@RTW](https://community.fly.io/u/RTW)\
**Post date:** [January 6, 2024, 4:05pm UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/6 "2024-01-06T16:05:34Z")

</div>

Thanks for the clarification. Ill give this a try.

---

<div class="post-metadata">

**Author:** ![RTW](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rtw/32/17364_2.png) [@RTW](https://community.fly.io/u/RTW)\
**Post date:** [January 6, 2024, 4:28pm UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/7 "2024-01-06T16:28:11Z")

</div>

Hey @rubys that worked but now I am running into anther issue. It looks like I am over my usage on Redis commands.

 ![image](https://global.discourse-cdn.com/fly1/original/3X/c/5/c5ea303c048ac0dbc089816bc4ee48b1d2a68534.png)

I am curious if you have any advice on how to debug why this may be, or how I can look into what may be causing this?

Thanks again for the help!

---

<div class="post-metadata">

**Author:** ![RTW](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rtw/32/17364_2.png) [@RTW](https://community.fly.io/u/RTW)\
**Post date:** [January 6, 2024, 4:55pm UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/8 "2024-01-06T16:55:56Z")

</div>

I was looking at [Managing Redis rate limits on Sidekiq and Rails](https://community.fly.io/t/managing-redis-rate-limits-on-sidekiq-and-rails/6741) and it looks like depending on my concurrency the checks that sidekiq makes for more items in the Redis instance may be too high.

Here are my configs:

**Sidekiq**

```auto
:concurrency: <%= ENV["SIDEKIQ_MAX_THREADS"] || 8 %>
:timeout: 8

:queues:
  - ["high", 6]
  - ["default", 4]
  - ["mailer", 2]
  - ["low", 1]

max_retries: 0

```

I have made the following updates based on what @jsierles suggested in the post I linked above:

**config/initializers/sidekiq.rb**

```auto
Sidekiq.configure_server do
  Sidekiq::BasicFetch::TIMEOUT = 15
end

```

**config/sidekiq.yml**

```auto
:concurrency: <%= ENV["SIDEKIQ_MAX_THREADS"] || 1 %>
:timeout: 8

:queues:
  - ["high", 6]
  - ["default", 4]
  - ["mailer", 2]
  - ["low", 1]

max_retries: 0

```

And then I set my **SIDEKIQ\_MAX\_THREADS** environment variable to **1**.

This is what I think is happening:

My concurrency is too high for the needs of my system. This is leading to too many commands being sent to Redis to check for items to process. This would explain why **Bandwidth** , **Storage** and **Cost** numbers in my Redis dashboard are so low while **Commands** are through the roof.

---

<div class="post-metadata">

**Author:** ![rubys](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rubys/32/16907_2.png) [@rubys](https://community.fly.io/u/rubys)\
**Post date:** [January 6, 2024, 5:04pm UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/9 "2024-01-06T17:04:16Z")

</div>

Something that might be worth exploring: [Migrating from Sidekiq to Solid Queue | Kyle Keesling](https://kylekeesling.com/posts/2024/01/migrating-from-sidekiq-to-solid-queue)

---

<div class="post-metadata">

**Author:** ![RTW](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rtw/32/17364_2.png) [@RTW](https://community.fly.io/u/RTW)\
**Post date:** [January 6, 2024, 5:12pm UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/10 "2024-01-06T17:12:11Z")

</div>

Thanks. I will take a look see.

---

<div class="post-metadata">

**Author:** ![RTW](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/rtw/32/17364_2.png) [@RTW](https://community.fly.io/u/RTW)\
**Post date:** [January 6, 2024, 5:22pm UTC](https://community.fly.io/t/rubygems-update-requires-ruby-version-3-0-0/17571/11 "2024-01-06T17:22:26Z")

</div>

So I updated my **SIDEKIQ\_MAX\_THREADS** to **1** for the time being and made **Sidekiq::BasicFetch::TIMEOUT = 15**. I then trued to deploy my app again, which worked.

I am going to monitor the commands and my sidekiq throughput/latency and see how my config changes may have helped.

What I am curious about is the following:

> [@Managing Redis rate limits on Sidekiq and Rails](https://community.fly.io/t/managing-redis-rate-limits-on-sidekiq-and-rails/6741/12):
>
> Good news - for the time being, free plans are now capped at 100MB bandwidth instead of 10k commands. Can you try again with these hacks removed?

Is this true and if so why did I get an error saying that I need to upgrade if the free trier is capped on bandwidth and not commands.
