How to start programming in Ruby in 7 easy steps
Software Development
Damian Watroba
Damian Watroba
Software Engineer
2020-03-04

How to start programming in Ruby in 7 easy steps

How to start programming in Ruby? This question tends to appear in various groups and online forums. To make things easier, I have prepared a shortlist for people who would like to start their adventure with the Ruby language.

1. Choose the right operating system

The basic element of every programming environment is the operating system. Let's start with the most popular one, Windows. Until recently, learning Ruby on this operating system was very hard due to problems with the configuration of the environment. Such problems could effectively discourage further learning. Now, there is nothing to worry about – it all changed some time ago thanks to the Windows Subsystem for Linux tool (WSL for short). As the name suggests, it is a Linux subsystem. The principle is simple – you run Linux on your Windows computer.

How to install WSL?

I started my own adventure with Ruby by installing Linux on one of the most popular distributions, Ubuntu. As a Windows user, I was curious to test another system. Additionally, this system was often mentioned in job offers for Junior Ruby Developers, mentioning the requirement of at least basic knowledge of Linux. So, if you are a Windows user, I sincerely recommend installing an additional system on the side. The time spent with Ubuntu allowed me to both learn about one of the most popular open-source software types and form my own opinion about it.

How to install Ubuntu?

If you own and use a macOS, you don't need to install any additional systems or software. This system comes from a family of Unix operating systems, just like Linux, so you can safely move on to the next point.

Fronented Report for 2020

2. Terminal – learn the basics

The next step is to familiarize yourself with the terminal (also called the console or the command line) in your system and learn to navigate among catalogs, file operations, data displays and many other things you can encounter there. This is one of the developer's basic tools. The beginnings may seem difficult, but in time you will see that there is nothing to be afraid of. The sooner you start using the terminal and learning commands, the better. At the very beginning, I recommend a course from Codecademy: Learn the Command Line. Unfortunately, it is only available in the PRO version, but you can use a 7-days free trial during which you can access the material.

Terminal for beginners - part 1

3. Find a good text editor

The next tool you need is an appropriate text editor. I encourage you to try one of the popular ones (i.e., Visual Studio Code, Atom, Sublime, or Brackets) and decide for yourself which editor work best for you. I use VSC with the appropriate Ruby plugins.

How to install the Visual Studio Code?

Visual Studio Code

4. Master the Git

Git is a distributed version control system. It’s another basic tools that your will have to master to become a Ruby developer. One of the main functionalities of Git regards recording changes in your project. It also allows you to view history and, if necessary, restore the selected version of your program. For now, you will need it to install another tool as the next step. Time for more installing!

How to install Git?

5. Install rbenv / rvm

Tools such as rbenv and rvm allow you to install and support different versions of Ruby on our system and switch between them. The thing to keep in mind is that those tools don't work together, so your need to choose one of them. I recommend rbenv.

How to install rbenv or rvm?

6. Install Ruby

When we are publishing this entry, the 2.7.0 version of Ruby is underway. Nevertheless, I recommend installing the latest (to date) stable 2.6.5 version. To do this, your need a rbenv extension called ruby-build. How to do it? You can learn it in the link below:

How to install: ruby-build?

7. Get acquainted with gems and the bundler

Gems are libraries designed for Ruby. On rubygems, you can find various useful gems to use while studying and continuing your work as a developer. One of them is the bundler, which provides a consistent environment for various projects and installs the necessary gems in their appropriate versions for specific projects.

How to install the bundler?

Ruby gems

With the environment set up in this way, you can easily start learning the programming and basics of Ruby. If you would like to start learning right away but you're uncomfortable with the number of tools you may need, you can use online editors. One of them is repl.it, where you can run a simple code written in Ruby.

Good luck! And here you can read the article in the polish version.

Read more:

- How to start building your product from scratch?

- 10 UI/UX design trends for 2020. What’s new?

- The most tiresome contemporary challenges for Tech Leaders

Software development consulting