Learning Management Platform for Written Tutorial Series.

Ruby on Rails Installation

Ruby on Rails Installation

Introduction

In this tutorial, we will show you how to install and configure ruby on rails. Installing and getting Ruby on rails to work can be a pain in a quite significant part of the body if it’s not done right. If you are not a fan of command line then it even becomes worse.

This tutorial will show you the easiest way of installing and configuring ruby on rails.

Topics to be covered

We will cover the following topics in this tutorial.

  • Key software components for Ruby on Rails
  • Other software needed when working with ruby on rails
  • How to install ruby on rails
  • Testing the installation

Key software components for Ruby on Rails

The following are the key software components that you will need to start developing and running ruby on rails applications.

  1. Ruby – ruby on rails is built on ruby language. You will need ruby installed before you can install ruby on rails
  2. Web Server – We will need the web browser to host and run our application. By default, ruby on rails ships with Webrick
  3. DevKit – this is a tool that makes it easy to build and use native C/C++ extensions for ruby on windows. C/C++ extensions will greatly improve the performance of your application.
  4. Ruby on Rails – this is the actual ruby on rails framework.
  5. Bundler – bundler is used to manage ruby gems. A gem is a software component that performs a specific task. mysql2 is an example of a gem that is used to connect to MySQL database from ruby on rails. Bundler is used to install all the required gems for a project after you have created the project. You can read more about bundler from the official website bundler.io

Other software needed when working with ruby on rails

In addition to the above, you will need the following tools.

  1. Integrated Development Environment (IDE) – An IDE will make you more productive. I personally use Aptana Studio when developing ruby on rails web applications. It’s a great IDE (my opinion), it’s free and cross platform.
  2. Web Browser – We need the web browser to access the web application. it’s better to use a modern web browser that supports HTML5
  3. Command line tool – ruby on rails uses the command line a lot to automate commonly performed tasks. Aptana has a built in command line in the IDE. I prefer IDEs that have built in command line terminals so that I don’t have to switch between different programs when developing.
  4. MySQL (optional) – it’s not required but highly recommended. Most web applications interact with databases. It’s possible to use SQLite, PostgreSQL etc. but MySQL is a cost effective popular choice

How to install ruby on rails

The easiest way to install ruby on rails is using RailsInstaller. RailsInstaller has all the components that you need to get ruby on rails running. It works for windows and Mac OS. RailsInstaller installs and configures the default framework settings for you.

You can download rails installer from the official web site railsInstaller.org

Installing RailsInstaller is just like installing any other program so we will not cover that in this tutorial. Make sure you select all the components included in the RailsInstaller. Use the comments section below to ask if you run into any problems.

Alternatively, you can install ruby language and use the command line to ruby on rails.

Testing the installation

Open the command line terminal

Run the following command to check the version of ruby

ruby –v

The above command should show you the version of ruby that you have installed

rails –v

the above command should show you the version of ruby on rails that you have installed

gem list

the above command will list all the ruby gems that you have installed

The following image shows what you should get or something similar to it after executing the above commands.

Ruby commands result

Summary

In this tutorial, we learnt how to install ruby on rails and interact with ruby using the command line.

What’s next?

In the next tutorial, we will show you how to create a hello world web application in ruby on rails

If you found this tutorial useful, support us by using the social media buttons to like and share the tutorial. If you didn’t find it useful, please use the comments section below to let us know how we can do better next time.

Each week, a new Ruby on Rails tutorial is added to our collection. Subscribe to our newsletter, like our Facebook fan page or follow us on Twitter to get free updates when the collection is updated.

Tutorial History

Tutorial version 1: Date Published 2015-09-21


...