You're probably following a tutorial for this. Did the tutorial told you to use Rbenv? or RVM?

You might have already tried this, but in case you have not, here is what I would do:

sudo apt install ruby-full
ruby --version

Now if you truly want to use RVM or Rbenv, you might need to review their installation. Also, you COULD TRY running this command:

sudo apt install build-essential

If it still does not work, try the above mentionned answer. Hope I could help!

Answer from Hwiparam on Stack Overflow
🌐
Ruby
ruby-lang.org › en › documentation › installation
Installing Ruby | Ruby
$ sudo snap switch ruby --channel=2.3/stable $ sudo snap refresh · Gentoo uses the portage package manager. ... To install a specific version, set RUBY_TARGETS in your make.conf. See the Gentoo Ruby Project website for details. Arch Linux uses a package manager named pacman. To get Ruby, just do this: ... Ruby versions 2.0 and above are included by default in macOS releases since at least El Capitan (10.11). Homebrew is a commonly used package manager on macOS. Installing Ruby using Homebrew is easy:
🌐
GitHub
gist.github.com › MichaelCurrin › fb758aea4d35e03b9ed093afddf4e7ec
Install Ruby 3 and Bundler · GitHub
See the ruby (for @3.0) and ruby@2.7 formulae on the Homebrew site. ... Add to your PATH in Bash config (.bashrc) or ZSH config (.zshrc) to make the Brew install of Ruby accessible.
Discussions

Unable to Install Ruby 3.0.2 on Ubuntu 22.10 - Stack Overflow
I've tried using both Ruby Version Manager (RVM) and RBENV to install 3.0.2 and both times I get some kind of Make error, but can't make heads or tails of the log files. Here is the console log for More on stackoverflow.com
🌐 stackoverflow.com
Install later versions of Ruby in Ubuntu 18.04 using apt
You'll want to use rbenv, rvm, chruby, asdf like you normally would. apt packages aren't designed for supporting multiple versions, so you don't want to use them typically. More on reddit.com
🌐 r/ruby
6
6
August 2, 2022
How to install ruby 3.1.2 in an Ubuntu Docker container? - Stack Overflow
I tried: if ! command -v ruby &> /dev/null then # - proverbot's version # First, install Ruby, as that is for some reason required to build # the "system" project # ... More on stackoverflow.com
🌐 stackoverflow.com
What is the correct way to install ruby on ubuntu 22.04 - Stack Overflow
So what are the correct steps to install ruby on Ubuntu 22.04? ... you are correct, few weeks ago i had same problem as you with openssl. i had to downgrade ubuntu to 20.04 ... I am on the very same page here and honestly, downgrading doesn't look a bad option atm. ... Sign up to request clarification or add additional context in comments. ... Warning: even if Ruby compiles with it, some gems will not work! Especially MySQL gem, that compiles with OpenSSL 3 ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Vultr
docs.vultr.com › how-to-install-ruby-on-ubuntu-24-04
How to Install Ruby on Ubuntu 24.04 - Complete Guide | Vultr Docs
January 31, 2025 - ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-linux] ... Ruby Version Manager (RVM), also known as Ruby environment manager is a command-line tool used to install, manage, and work with multiple Ruby environments on a server. You can use RVM to install Ruby and switch between different Ruby versions. Install the required GPG keys for RVM. ... $ gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB Explain Code
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install ruby on ubuntu
How to Install Ruby on Ubuntu | phoenixNAP KB
December 16, 2025 - Follow the steps below to install Ruby with RVM: 1. Update the system package repository information with: ... sudo apt install curl g++ gcc autoconf automake bison libc6-dev libffi-dev libgdbm-dev libncurses5-dev libsqlite3-dev libtool libyaml-dev make pkg-config sqlite3 zlib1g-dev libgmp-dev libreadline-dev libssl-dev -y · Wait for the installation to complete. 1. Add the GPG key used to verify the RVM installation file: gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
🌐
Geekflare
geekflare.com › development › how to install ruby on ubuntu 22.10
How to Install Ruby on Ubuntu 22.10
December 28, 2024 - For demonstration purposes, we will install Ruby-3.2.1. Use this command; ... We have installed rbnev using Git. Whenever a new version is created, you can install it through these commands; ... As time passes, you may have more Ruby versions than you need in your machine. You can uninstall such ruby versions using this command; ... Step 1: Remove rbnev files from bash. ... You can now log out to let the changes apply. Since we now have Ruby installed on Ubuntu, we can create a hello world to demonstrate how it works.
Find elsewhere
🌐
Serverspace
serverspace.io › support › help › install-ruby-on-rails-ubuntu-20-04
How to Install Ruby on Rails 3.1.2 on Ubuntu 20.04 Server: Step-by-Step Guide
May 30, 2025 - However, this can not always be attributed to the advantages of Ruby on Rails. It can cause problems and make it difficult to pass a project to other team members, as the same function can be implemented in different ways, creating confusion. Whereas Python advocates that there should only be one obvious way to do something, which makes the code easier to debug and read. Cloud Servers from €4 / moIntel Xeon Gold 6254 3.1 GHz CPU, SLA 99,9%, 100 Mbps channeltry ... sudo apt-get install zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn -y
🌐
Server World
server-world.info › en › note
Ubuntu 22.04 : Install Ruby 3.0 : Server World
August 26, 2022 - This article provides an example of how to install Ruby 3.0 from a package and check that it works on Ubuntu 22.04 LTS.
🌐
Stack Overflow
stackoverflow.com › questions › 74695464 › how-to-install-ruby-3-1-2-in-an-ubuntu-docker-container
How to install ruby 3.1.2 in an Ubuntu Docker container? - Stack Overflow
I ran sudo apt-get update then sudo apt-get upgrade ruby-build then mkdir -p ~/.local then ruby-build 3.1.2 ~/.local/ and the error is ruby-build: definition not found: 3.1.2 · #!/usr/bin/env bash # - Get the Ubuntu version for the Ubuntu image #docker run -it --rm ubuntu:20.04 /bin/bash docker run -it --rm ubuntu:18.04 /bin/bash apt-get update && apt-get install -y lsb-release && apt-get clean all lsb_release -a #apt-get install git apt-get update apt-get upgrade ruby-build apt-get install rbenv apt-get install ruby-build rbenv install 3.1.2 # - Get Ubuntu version for the 'miniconda3' Docker image docker run -it --rm continuumio/miniconda3:latest /bin/bash #sudo apt-get install lsb-release #apt-get install lsb-release apt-get update && apt-get install -y lsb-release && apt-get clean all lsb_release -a
🌐
Stackify
stackify.com › install-ruby-on-ubuntu-everything-you-need-to-get-going
Install Ruby on Ubuntu: Everything You Need to Get Going - Stackify
February 29, 2024 - However, if we install with Snap, we’ll get the latest stable release, 2.6.3. The Snap CLI came installed on Ubuntu 18.04.2, so you should have no problem if you’re using that or even a version as old as 16.04. If you want the latest version of a package, and you are on Ubuntu 16.04 or later, use Snap. If you’re working on an older version of Ubuntu, or aren’t concerned with having the latest version of Ruby, you can use APT.
🌐
UbuntuMint
ubuntumint.com › home › how to install ruby on ubuntu using apt, rvm, and rbenv
How to Install Ruby on Ubuntu Using Apt, RVM, and rbenv
December 4, 2023 - In this blog, you will walk through three distinct methods for installing Ruby, presented one after another. If you only require a single stable version of Ruby then the apt package manager (Official Ubuntu Repository) method is recommended.
🌐
UltaHost
ultahost.com › knowledge-base › install-ruby-on-ubuntu
How to install Ruby on Ubuntu | Ultahost Knowledge Base
May 17, 2024 - Rbenv allows you to set a global Ruby version that will be used by default in your terminal. Use the following command replacing 3.2.5 with the version you want to set globally: ... After that, you can verify the ruby installation by running the version command. ... Install Ruby on Our Ubuntu VPS!
🌐
ComputingForGeeks
computingforgeeks.com › home › dev › how to install ruby on ubuntu 22.04|20.04|18.04
How To Install Ruby on Ubuntu 22.04|20.04|18.04 | ComputingForGeeks
May 5, 2022 - Install Ruby with the rvm install commands. You can check Ruby releases to get version number. ... 3.1.2 Searching for binary rubies, this might take some time. No binary rubies available for: ubuntu/22.04/x86_64/ruby-3.1.2. Continuing with ...
🌐
Ace Cloud Hosting
customer.acecloudhosting.com › index.php › knowledgebase › 224 › How-to-Install-Ruby-on-Ubuntu-20.04-and-Setting-up-Programming-Environment..html
How to Install Ruby on Ubuntu 20.04 and Setting up Programming Environment. - Real Time Cloud Services LLC
This command will download and install Ruby's latest version. By stating the version number, you can also specify a specific Ruby version. For example, to install Ruby 3.0.2, enter the following command:
🌐
Ruby on Rails
guides.rubyonrails.org › install_ruby_on_rails.html
Install Ruby on Rails Guide — Ruby on Rails Guides
Enter a username and password for your Ubuntu user when prompted. ... # Install dependencies with apt $ sudo apt update $ sudo apt install build-essential rustc libssl-dev libyaml-dev zlib1g-dev libgmp-dev # Install Mise version manager $ curl https://mise.run | sh $ echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc $ source ~/.bashrc # Install Ruby globally with Mise $ mise use -g ruby@3 Copy
🌐
Ruby Programming Language
ruby-lang.org › en › downloads
Download Ruby | Ruby
Here you can get the latest Ruby distributions in your favorite flavor. The current stable version is 4.0.3. Please be sure to read Ruby’s License. We have several tools on each major platform to install Ruby:
🌐
UbuntuHandbook
ubuntuhandbook.org › home › howtos › how to install ruby in ubuntu 24.04 lts
How to Install Ruby in Ubuntu 24.04 LTS | UbuntuHandbook
Then, run command to list all available Ruby versions: ... Or skip the INTERPRETER, and use rvm install 3.3.0 instead.