On the RubyInstaller download page, do not take the highlighted version: choose Ruby+Devkit 3.3.x (x64) in the list (the most recent 3.3 version).
During installation, keep the option that adds Ruby to the PATH ticked. At the end, leave the ridk install box ticked: a console opens and offers to install MSYS2 and the build toolchain; press Enter to accept the default choice. This Devkit is essential: on Windows, bundle install has to compile some gems.
Close and reopen the terminal, then check:
ruby -v
gem install bundler
ruby -v must display ruby 3.3.x.
With Homebrew, install version 3.3 explicitly (brew install ruby would install the latest version):
brew install ruby@3.3
echo 'export PATH="$(brew --prefix ruby@3.3)/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
ruby -v
gem install bundler
ruby@3.3 does not replace the Ruby supplied with macOS: the line added to ~/.zshrc puts it first in the PATH. ruby -v must display ruby 3.3.x, and not ruby 2.6 (the macOS one).
Start by checking the version offered by your distribution:
If the candidate version starts with 1:3.3 (this is the case with Ubuntu 26.04, for example), install it directly:
sudo apt update
sudo apt install ruby-full build-essential zlib1g-dev
gem install bundler
Otherwise (Ubuntu 24.04 and Debian 12 provide an older version, others a more recent one), install Ruby 3.3 with rbenv, which compiles Ruby in your home folder:
sudo apt update
sudo apt install git build-essential libssl-dev libyaml-dev zlib1g-dev libffi-dev libreadline-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc
source ~/.bashrc
rbenv install $(rbenv install -l | grep -E '^3\.3\.' | tail -1)
rbenv global $(rbenv versions --bare | grep -E '^3\.3\.' | tail -1)
gem install bundler
Compilation takes a few minutes. In all cases, ruby -v must display ruby 3.3.x.