How to Install Ruby on Rails

How To Install Ruby on Rails?

March 25th, 2026
17169
5:00 Minutes

Ruby on Rails, also commonly just called Rails, is an open-source software that is written in the Ruby language. This server-side, free web app development framework, curated with the purpose of making the process of programming web apps easier. Rails is an MVC or model-view-controller framework. This means it facilitates the programmer to accomplish more with less code. It has gained a lot of popularity in recent years, and continues to be a favorite among developers. In this blog, we are going to discuss how setup and install Ruby on Rails.

Learn Rails with igmGuru's advanced Ruby on Rails Course program.

How to Install Rails on Windows?

To install Rails on Windows, these steps must be followed.

Step 1: Check the Ruby Version

The first thing to do during Ruby on Rails installation is to check whether you have Ruby already installed. To do this, open the 'command' prompt, and type 'ruby -v'. Upon responding, if the version number is at or above 2.2.2, type 'gem --version'.

If you do not get an error, skip the next step. Otherwise, you will have to install Ruby on Windows.

Step 2: Install Ruby on Windows

Install Ruby On Rails

If Ruby is not already installed, then you can do so by downloading the installation package by going to rubyinstaller.org.

Click on the 'download' link and then run the resulting installer. It's a small package, gets installed in one click, and you get RubyGems along with it.

Step 3: Install Rails

Now that you have RubyGems, installing Rails and its dependencies can be done with a single command line -

C:\> gem install rails

gem install ruby on rails

NOTE: It might take a little while to install all the dependencies. Hence, be certain to stay connected to the internet.

Step 4: Check Rails Version

To check the Rails version, use this command.

C:\> rails -v

The output you will get -

Rails 4.2.4

And voila! Your Ruby on Rails download is complete and you can enjoy Ruby on Rails Windows.

Related Article- How To Become Ruby On Rails Developer?

How to Install Ruby Ubuntu?

To install Ruby Ubuntu, there are a few ways you can follow. In this blog, we will be using Rbenv for installing Rails in Ubuntu. Another tool named ruby-build is needed to install Ruby.

Before we move to the steps, let's make an important pitstop.

Prerequisites for Ruby on Rails Installation on Ubuntu

Before we move on to the steps that you must undertake for Ruby on Rails installation, here are the two key installations you must have-

  • Apache (or any preferred web server of your choice)
  • A database service (like MySQL)

To update Ubuntu 20.04, use-

sudo apt update

To install Ruby dependency packages, use this command-

sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev

Once the installation of dependency packages is complete, use this command to clone both Ruby-build and Rbenv repositories at GitHub.

curl -sL curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash

Run this command to set path in .bashrc-

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrcecho 'eval "$(rbenv init -)"' >> ~/.bashrcexec $SHELL

Any available Ruby version can be installed using Rbenv. Use this command to list the available Ruby version.

rbenv install -l

This is the output you will get-

rbenv install

With this example, we will be installing Ruby 3.1.2. Replace the version number with the one of your choice.

rbenv install 3.1.2

rbenv install 3.1.2

Ste the global variable with this command-

rbenv global 3.1.2

Verify installation with this command-

ruby -v

The output you will get will be similar to-

Outputruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

Install bundler with this command-

gem install bundler

Wrapping Up Ruby on Rails Installation

When it comes to installing Ruby on Rails, the process may vary depending upon where you are installing it. Hence, where you wish to install Ruby on Rails mac, Ubuntu, or Windows, you will have to follow slightly different steps.

This process, install ruby on rails, is a necessary step on your journey to learn Ruby on Rails. Practicing will make you perfect at using this framework for web app development.

You can also read: What is ChatGPT

FAQs

Q1. What is required for Ruby on Rails?

Rails suggests using Ruby version 2.7.0. You should prefer going for the latest Ruby version.

Q2. What is the difference between Ruby and Ruby on Rails?

There are various differences between Ruby and Ruby on Rails. The primary one is that Ruby is a scripting language, whereas Ruby on Rails, (which is also referred to as RoR), is a widely used web app framework. These both are extremely widely used for programming solutions and tasks.

Q3. Which framework is Ruby on Rails?

Ruby on Rails is an MVC or a model- view- controller framework. Thus, it provides default structures for a web service, web pages, and a database (DB).

Q4. Does Ruby on Rails follow the MVC architecture?

Yes, Ruby on Rails uses the Model–View–Controller (MVC) architecture.

Course Schedule

Course NameBatch TypeDetails
Ruby and Rails Training
Every WeekdayView Details
Ruby and Rails Training
Every WeekendView Details
About the Author
Piyush Verma | igmGuru
About the Author

Piyush is a technical writer skilled in Golang, R, C, C#, C++, Ruby, and ERP systems. He simplifies complex coding concepts into clear, beginner-friendly content, helping readers build strong foundations. With a structured approach, he supports both beginners and professionals in mastering technologies and advancing their careers.

Drop Us a Query
Fields marked * are mandatory

Programming Certification Courses

×

Your Shopping Cart


Your shopping cart is empty.