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.
- For installation of Ruby on Windows, visit How to install Ruby on Windows?
- For installation of Ruby on Linux, visit How to install Ruby on Linux?
- For installation of SQLite3 on Windows, visit How to Install SQLite3 on Windows and Linux?
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
$ rails server
Step 6: Now navigate to the localhost 3000 and you will be able to see the following output:
- Difference Between Laravel and Ruby on Rails
- How to Install R Studio on Windows and Linux?
- How to install Ruby on Windows?
- How to install Ruby on Linux?
- install command in Linux with examples
- How to install the previous version of node.js and npm ?
- How to download and install Java for 64 bit machine
- How to enable PHP's openssl extension to install Composer ?
- How to Install php-curl in Ubuntu ?
- What is the meaning of --save for NPM install ?
- How to install php70-gd on Ubuntu ?
- Difference Between DOS and Windows
- How to set PHP development environment in windows ?
- How to Create a WiFi Hotspot in Windows 8 using Command-prompt?
- How to disable Windows Startup services?
- How to update Sound Drivers in Windows PC?
- How to Create a Desktop Shortcut in Windows?
- How to Disable Administrator Account in Windows?
- How to check Active Network Connections in Windows?
- How to Hide a Folder in Windows?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.