How to Install Ruby on Rails on Windows and Linux?

Ruby on Rails or just known as rails, is free and open-source software written in Ruby language under the MIT license. It is a server-side web application development framework, designed to make programming web applications easier by making assumptions about what every developer needs to get started. Rails is a model–view–controller (MVC) framework that allows one to write less code while accomplishing more than many other frameworks. Rails itself provides the structure for a database, web pages, and a web service. Being object-oriented and a high-level programming language, it is gaining much popularity.

Downloading and Installation

Before you install Ruby on Rails, make sure SQLite3 and Ruby are installed on your computer. To know whether you have SQLite3 and Ruby installed in your system, type the following command in your command line:

$ ruby –version
$ sqlite3 --version

If they are not installed, first we need to install them.

Now that you have SQLite3 and Ruby installed in your system, it’s time to install Rails, for installation and setting up of Rails, follow the steps given below:

Step 1: Type the following command in the ruby terminal:



 $ gem install rails 

This will install rails in both Windows and Linux operating systems.

Step 2: To verify that rails have been installed, type the following command and it should report its version.

 $ rails --version 

Step 3: To make your first web application in rails type the following command in the command line:

 $ rails new project 

where project is the name of your application.
It will show something like this:

Step 4: It will create a Rails application called project. Then, cd into that project using the following command:

 $ cd project 

Step 5: To start up your web server, type the following command:

 $ bin/rails server 

or just

 $ rails server 

Step 6: Now navigate to the localhost 3000 and you will be able to see the following output:

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.