Step-by-step Installation guide for Ruby

Installing Ruby on Xubuntu (My Notes from The Odin Project)

Before jumping into Ruby on Rails, we first need to set up Ruby itself.
It sounds simple, but trust me — this step can get messy if you skip details.

I went through this recently…


This content originally appeared on DEV Community and was authored by Lakshay Tyagi

Installing Ruby on Xubuntu (My Notes from The Odin Project)

Before jumping into Ruby on Rails, we first need to set up Ruby itself.

It sounds simple, but trust me — this step can get messy if you skip details.

I went through this recently while following The Odin Project, and here’s a cleaner, beginner-friendly walkthrough based on my own experience.

Why You Need Ruby First

Rails runs on Ruby, so before creating your first app, you need the correct Ruby version and a version manager to switch between them easily.

I’ll be using rbenv, which helps install and manage Ruby versions safely without touching system files.

Step 1: Update Your System

Always start fresh!

Open your terminal (Ctrl + Alt + T on Xubuntu) and update existing packages:

sudo apt update && sudo apt upgrade

This ensures your system’s libraries are current.
You’ll be asked for your password and to confirm updates — press Y when prompted.

Step 2: Install Required Dependencies

Ruby needs a few libraries and tools to build properly:

sudo apt install gcc make libssl-dev libreadline-dev zlib1g-dev libsqlite3-dev libyaml-dev

💡 Linux Tip:
Ctrl + Shift + C → Copy from terminal
Ctrl + Shift + V → Paste into terminal

Step 3: Install rbenv

rbenv lets you install and switch between Ruby versions easily.

Clone it from GitHub:

git clone https://github.com/rbenv/rbenv.git ~/.rbenv

Then initialize it:

~/.rbenv/bin/rbenv init

Now close your terminal and reopen it to refresh your environment variables.

Verify installation:

rbenv -v

You should see something like:
rbenv 1.x.x

Step 4: Add ruby-build Plugin

This plugin helps rbenv compile and install Ruby versions.

mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

Now rbenv can handle Ruby installations.

Step 5: Install Ruby

We’re finally ready! Run:

rbenv install 3.4.2 --verbose

⏳ This might take 10–15 minutes.
The --verbose flag lets you see progress so you know it hasn’t frozen.

If you get an error like:

ruby-build: definition not found: 3.4.2

Update ruby-build and try again:

git -C "$(rbenv root)"/plugins/ruby-build pull

Step 6: Set Default Ruby Version

Once installation completes, set it as your global Ruby version:

rbenv global 3.4.2

Verify with:

ruby -v

If everything worked, you’ll see something like:

ruby 3.4.2pXXX (20XX-XX-XX revision XXXXX) [x86_64-linux]

🎉 Congrats — you’ve officially installed Ruby!

What’s Next

With Ruby set up, you’re ready to install Rails and start building your first app.
You can also watch my video walkthrough of this process here 🎥 — [YouTube Link].

Credits

This post is inspired by The Odin Project’s “Installing Ruby” lesson.
I followed their guidance but rewrote this post based on my own notes and experience using Xubuntu Linux.


This content originally appeared on DEV Community and was authored by Lakshay Tyagi


Print Share Comment Cite Upload Translate Updates
APA

Lakshay Tyagi | Sciencx (2025-11-02T01:49:57+00:00) Step-by-step Installation guide for Ruby. Retrieved from https://www.scien.cx/2025/11/02/step-by-step-installation-guide-for-ruby-2/

MLA
" » Step-by-step Installation guide for Ruby." Lakshay Tyagi | Sciencx - Sunday November 2, 2025, https://www.scien.cx/2025/11/02/step-by-step-installation-guide-for-ruby-2/
HARVARD
Lakshay Tyagi | Sciencx Sunday November 2, 2025 » Step-by-step Installation guide for Ruby., viewed ,<https://www.scien.cx/2025/11/02/step-by-step-installation-guide-for-ruby-2/>
VANCOUVER
Lakshay Tyagi | Sciencx - » Step-by-step Installation guide for Ruby. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/11/02/step-by-step-installation-guide-for-ruby-2/
CHICAGO
" » Step-by-step Installation guide for Ruby." Lakshay Tyagi | Sciencx - Accessed . https://www.scien.cx/2025/11/02/step-by-step-installation-guide-for-ruby-2/
IEEE
" » Step-by-step Installation guide for Ruby." Lakshay Tyagi | Sciencx [Online]. Available: https://www.scien.cx/2025/11/02/step-by-step-installation-guide-for-ruby-2/. [Accessed: ]
rf:citation
» Step-by-step Installation guide for Ruby | Lakshay Tyagi | Sciencx | https://www.scien.cx/2025/11/02/step-by-step-installation-guide-for-ruby-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.