Site deploy failing because of Ruby & RubyGems compatibility

Netlify site name:
I’m trying to deploy a new site (from a git repository) on Netlify. I created this Gemfile in my root folder and ran the “bundle install” command.

Screenshot 2024-01-13 at 19.51.27

The deploy failed and the deploy log shows a problem in the “initializing phase”. Here’s the message:

7:35:34 PM: build-image version: ebe1739aa70e1db449262aa2ac466dad070382fb (focal)
7:35:34 PM: buildbot version: 211f66487a631406c3c0b2b43c8b33d0bb175356
7:35:34 PM: Building without cache
7:35:34 PM: Starting to prepare the repo for build
7:35:34 PM: No cached dependencies found. Cloning fresh repo
7:35:34 PM: git clone --filter=blob:none
7:35:35 PM: Preparing Git Reference refs/heads/master
7:35:36 PM: Starting to install dependencies
7:35:37 PM: Python version set to 3.8
7:35:37 PM: Attempting Ruby version 2.7.2, read from environment
7:35:37 PM: Using Ruby version 2.7.2
7:35:38 PM: Using Bundler version 2.5.4 from Gemfile.lock
7:35:51 PM: Failed during stage “Install dependencies”: dependency_installation script returned non-zero exit code: 1
7:35:50 PM: ERROR: Error installing bundler:
7:35:50 PM: There are no versions of bundler (= 2.5.4) compatible with your Ruby & RubyGems
7:35:50 PM: bundler requires Ruby version >= 3.0.0. The current ruby version is
7:35:51 PM: Error installing Bundler
7:35:51 PM: Failing build: Failed to install dependencies

I’ve tried installing the new version of Ruby but I’m a beginner developer and I’m unsure of what I’m doing. My client’s site must go live on Monday and I’m lost. I’d appreciate any help I can get!

Many many thanks in advance,

You can try using Ruby 3: Manage build dependencies | Netlify Docs