Introduction To Ruby Programming Language On Linux

Training Architect
course instructor image
David Smith
David loves computers, especially alternative operating systems, coding, and crazy desktop managers. David has been an avid Linux user since 1999, when he installed Slackware for the first time. Since then, he has taught himself the ins and outs of Linux and web programming.

Getting ready to code.


Exercise: Ruby Environment Setup


Learning Basic Ruby Syntax

Ruby Basics

Exercise: Getting Acquainted with Ruby (Hello World - Conditionals)


Exercise: Practice with Nested Hashes and Iterators


Exercise: Writing Methods


Exercise: Writing a Program that Utilizes a Class


Start Building a Log Parsing Program

Intermediate Ruby

Dive into concurrent processing models.

Advanced Ruby


This course will teach the basics of the Ruby programming language. We will cover basics of installing Ruby via the package manager of CentOS and Ubuntu, as well as installing Ruby with RVM, the Ruby Version Manager. We will learn the basic syntax of Ruby, and cover how to code our own methods, classes, modules and much more. Through the Intermediate and Advanced sections of the course we will build an Apache log parsing program. We will build upon it throughout the later lessons, until we end up with a nice working log parsing program.

Study Guides

Course Overview

The basics of what this course is going to cover

What's a Programming Language

Brief overview of programming languages and the kind of language Ruby is.

Installing Ruby

How to install ruby. Note the rvm installation method has changed slightly since this guide was written. Check the rvm website's installation instructions.

The Ruby Environment

Learn a little about the various Ruby command line tools.

Hello World!

Write your first ruby program!


Learn how to create a variable.

Types of Variables.

Learn about the types of variables in Ruby.

Basic Math

Learn how to do basic arithmetic in Ruby.


Learn how to make your program do more than one thing.

Conditionals Continued

Conditionals can do even more than we covered in the last lesson. Let's learn a little more.


These programming structures allow you do the same thing several times in a row, in order to operate on each element in an array or hash.

Arrays and Hashes

A deeper look at what we can do with arrays and hashes in Ruby.


We already know how to define a string, but Ruby offers so much more. Here we will look at ways to manipulate string data.

While Loop

Iterators help our when we have a data set already. But sometimes we don't have one, and we still need to run the same bit of code more than once. The while loop is one way of doing that.

For Loop

The For loop is another way to repeat code multiple times.

Loop Control

Sometimes you need to interrupt the loop in various ways. These special keywords will help you do this.


Here we will learn how to write our own methods.

Methods Continued

Let look at more complicated methods, and some of other things methods can do.

Using Classes

We're looking at classes, what they are and how we use them in Ruby

Creating Classes

Now that we know how to use classes, we will learn how to write them.

Creating Classes Continued

Here we will go into more depth about writing our own classes.

Variable Scope Revisited

We briefly mentioned variable scope earlier, but now we need to look at again, since we know more about classes and how to write them.

Class Methods and Singletons

Classes can have another kind of method, the class method. Here we will discuss how to use these, and a related topic, the singleton.

Log Parsing Program

Throughout the intermediate section of the course, we will be building a log parsing program. In this lesson we will talk about code organizational strategies in an MVC framework, and begin to write our program.

Strings and Escapes

Here we will look at special characters that can occur in strings, and how certain characters can change how our terminal window prints out data.

User Input

Some times the 'gets' method doesn't meet our needs, but we still need to collect user input. Here we will look at lower level means of getting input from the user.

Exception Handling

Ruby has a mechanism for what to do when the program or user does something unexpected. Here we will learn how to use this mechanism.

Filling in the MVC stubs

Here we will add code into our program stubs.

File Objects

We are going to need to read a file in order to parse the apache logs. Here we will look at Ruby's system for reading file data.

Reading a Log File

Here we will apply what we have learned in order to read a log file.

Regular Expressions

Regular expressions are a fancy way of matching patterns in string data. Here we will learn the basics.

Building the LogEntry Class

Since we now know how to break down a line of a log file, lets fir all this information into separate variables inside the LogEntry class.


Ruby has all sorts of way to handle time data. In this lesson we will learn how to work with time data in Ruby.

Symbols, Strings, and Comments

In this lesson we will learn about one of Ruby's more interesting features, the symbol. We will also learn how to make comments in our code.

Modules and Mixins

Ruby has a way to segment of sets of classes, and add functionality to other classes. In this lesson we will learn how to use these.

Advanced Math (Math Module)

Sometimes the basic arithmetic is not enough. Here we will learn how to do some more advanced math in Ruby.

Sorting Part 1

In this lesson we will figure out how to sort the data in the log file.

Sorting Part 2

In this lesson we will look at how to filter the data. We will also cover how to call a method using a symbol.

Exceptions Revisited

In this lesson we will go into more depth about exceptions.

LogEntry Display (Single Entry View)

Here we will write some code to display a single log entry.

Method Arguments Addendum

We've already looked at the basics of how to supply arguments to methods. In this lesson we will look at some other ways to do this.


In this lesson we will look at basic concurrent processing. We will learn how to create threads and use them.

Thread Queues

Sometimes we need to pass data between different threads. A thread queue can help us do that.

Progress Bar

In this lesson we will create a progress bar for our log parsing program.


In this lesson we will look at a mutex and how to use it to keep data in sync.


In this lesson we will discuss a minimal approach to concurrent processing, the Fiber.

Sub Processes, etc

In this lesson we will look at way to execute external programs, and interact with them.

Instructor Deck


certificate ribbon icon

Earn a Certificate of Completion

When you complete this course, you’ll receive a certificate of completion as proof of your accomplishment.

Looking For Team Training?

Learn More