Free Ruby tutorials in PDF

These courses teaches you the basics of Ruby on Rails, to get started smoothly. Ruby on Rails is a web framework based on the MVC design pattern and using the interpreted and object oriented Ruby programming language.

Ruby is a fully object-oriented, cross-platform interpreted language. In addition to being very intuitive, Ruby can be used as a scripting language in the same way as PERL or others, but its recent rise is mainly due to the appearance of Ruby on Rails, an extremely powerful web framework based on Ruby . These courses will teach you the basics of this language, its strengths, etc.

Installation and basic concepts

Let's see how to install Ruby on Windows.
Nothing too complicated, just go to Ruby's page, then click on "Downloads", and download the One-Click Installer for Windows. All you have to do is choose your installation directory and validate until the installation procedure is complete.

Ruby comes with two editors by default: SciTe and FreeRIDE.

To launch FreeRIDE (written entirely in Ruby), go to the Ruby installation directory, then to the "freeride" directory, and run "run.bat".

I prefer SciTe, but that only depends on personal considerations. To launch it, go to the Ruby installation directory, then to the "scite" directory, and run "SciTE.exe".

In Ruby, everything is object. Absolutely everything. An integer, a string, and even classes, as surprising as it may seem.

First steps

We will learn by experience. For that, we will use irb (Interactive Ruby).

Using irb, we will be able to test Ruby's basic syntax and directly view the result, without having to create a file containing our code (a .rb) and modify it each time. You just have to launch a DOS window (start -> run -> cmd), then type "irb" in the command prompt, and validate.

Manipulation of simple variables

The command prompt has changed. You can now directly type your orders. Try typing the following lines:

  • a = 2
  • b = 3
  • puts "a + b is worth" + (a + b) .to_s

Here's what you should get on the screen:

irb (main): 001: 0> a = 2

=> 2
irb (main): 002: 0> b = 3
=> 3
irb (main): 003: 0> puts "a + b is worth" + (a + b) .to_s
a + b is 5
=> nil

Many things in this simple example. We have just created two variables, a and b, and assigned them values. Then we decided to display their sum using the puts method. So we display a string (the part in quotation marks), which we concatenate to another string using the + operator.

This second string is actually the result of the sum of our two variables (again this time using the + operator, which does not have the same function depending on the type with which it is used), which we let's convert to a string using the to_s method (to make concatenation possible, we need two identical types).

You will notice that nowhere have we defined the type of a or b. Ruby manages like a big one: it's the duck typing (it looks like a duck, it behaves like a duck, so it's a duck).

 

  • Ruby on Rails PDF Tutorial

    Learn the basics of Ruby on rails programming language, free training document in 250 pages for all level users.

  • Learn Ruby on Rails, PDF Tutorial

    This is a PDF tutorial about Ruby on Rails under 39 pages by Bhaskar Vaish, you will learn how to build web application using a Rails framework application.

  • Getting Started with Ruby programming language

    A complet tutorial about Ruby programming language under 594 pages for advanced level students, free training document in PDF by David Flanagan and Yukihiro Matsumoto.

  • Learning Ruby on Rails

    This course aims to give you the basics to start ruby coding on the ruby on rails framework. It will teach you the logic to follow when performing a Ruby project, as well as the use of external resources (libraries, gem ...)

  • Ruby programming tutorial

    Download free Ruby tutorial course in PDF, training file in 69 chapters and 235 pages. Free unaffiliated ebook created from Stack OverFlow contributor.

  • Ruby On Rails Programming Tutorial

    Download free Ruby On Rails tutorial course in PDF, training file in 73 chapters and 231 pages. Free unaffiliated ebook created from Stack OverFlow contributor.

  • Essential Ruby

    This book written to provide clear and concise explanation of topics for programmers both starting to learn the Ruby programming language as well as those diving in more complex topics. Most examples are linked to online playground that allows you to change the code and re-run it.

  • Essential Ruby On Rails

    This book written to provide clear and concise explanation of topics for programmers both starting to learn the Ruby On Rails programming as well as those diving in more complex topics. Most examples are linked to online playground that allows you to change the code and re-run it.

  • Ruby Hacking Guide

    The Ruby Hacking Guide is a book that explains how the ruby interpreter (the official C implementation of the Ruby language) works internally. To fully understand it, you need a good knowledge of C and Ruby. This book is going to investigate ruby as a whole.

  • Ruby Regexp

    Scripting and automation tasks often need to extract particular portions of text from inpu..., download free Ruby tutorial in PDF (72 pages) created by .