Ruby Programming Language



The Best Way To Learn Ruby

If you have decided to learn Ruby & become a Ruby developer then you’re in the right place.

In 2001, the first English book on Ruby, Programming Ruby (“The Pickaxe”), was published in 2001. With this new information on Ruby, many more people were able to learn the language. Ruby has been described as a multi-paradigm programming language: it allows procedural programming (defining functions/variables outside classes makes them part of the root, 'self' Object), with object orientation (everything is an object) or functional programming (it has anonymous functions, closures, and continuations; statements all have. RubyLearning.com is a thorough collection of Ruby Study Notes for those who are new to the Ruby programming language and in search of a solid introduction to Ruby's concepts and constructs. Speed up your Ruby programming learning process by joining 1000s of other would-be Ruby developers around the globe at the Online RubyLearning Class. Learn Ruby from a top-rated web development instructor. Udemy offers basic to advanced Ruby courses to help you build programs in the Ruby language and land your dream web development gig as a professional Ruby developer.

You’ve a lot of learning ahead of you, but don’t let that stop you from getting started.

Learning is a beautiful thing.

Now:

Where do you begin?

You should start by learning the core programming concepts.

Things like:

  • Variables
  • Data structures
  • Conditional statements

You’ll find a lot of new words in your journey, don’t worry about that, you’ll learn along the way.

You also need to understand that a programming language is a formal language.

What does that mean?

In English, if I make a grammar mistake there is a pretty good chance you can still understand me.

But if you make that kind mistake in Ruby, or any other programming language, you’re going to get an error.

You’ve to understand the rules of the language, then apply them correctly.

I’m telling you this is because I don’t want you to give up early if you’re seeing a lot of error messages & if things don’t make a lot of sense.

These things are normal:

You are learning something new & it’s going to take some time until it starts to sink in.

One of the keys is repetition.

Work on every topic until you understand how it’s useful in the big picture, how to use it, how to explain it to other people.

This Ruby tutorial helps you learn step-by-step, so don’t skip steps. Invest as much time as you need, have patience.

You can do this!

Let’s get started with the first step…

How to Download & Install Ruby

If you are using Windows you want to go to this site to download Ruby:

You want the recommended version (it’s in bold text), which at the time of this writing is Ruby+Devkit 2.6.5-1 (x64).

Just download & install it like any other program.

If no errors appear then you have Ruby installed on your computer!

Now to start writing your Ruby programs you will need to open a terminal.

To do that open the windows menu & type cmd.exe.

Then press enter.

It will look something like this:

At this point you should be able to type ruby -v inside this window & get the current version of Ruby printed in there.

Ruby Setup For Linux & Mac Users

If you are on Linux or MacOS then you probably already have Ruby installed.

You can confirm this by opening a terminal (search for “terminal” in your menu), then typing ruby -v.

This should print your Ruby version.

Like this:

If you don’t get a Ruby version then refer to this site for more details on how to install Ruby for your particular Linux version or Mac.

Download Ruby

Let’s Write Some Code!

Now that you are set up, I want you to open irb.

This is a Ruby program that allows you to type Ruby code & see the results right away.

It’s a great way to practice & learn about Ruby.

To open irb you have to type the word irb inside that black terminal window I had you open before.

Press enter.

Then you should see something like this:

Start by typing this into irb:

Then press enter.

You’ll see the result of this operation.

“But I can do that with a calculator program!”

Of course.

The point of this is to get you used to typing inside the terminal window.

And you’re going to be using numbers a lot inside your Ruby programs:

Ruby programming language release date

Ruby Programming Language Logo

  • As data (price, age, year, etc.)
  • To count things
  • To access information
Language

We’re just getting started here, so don’t worry if this seems too simple.

Other Ways to Run Ruby Code

Besides using a program like irb, you can run Ruby code in other ways.

For example, you can save the code inside a file ending in .rb, then use the ruby command + the file name.

Like this:

Notice that this has to be done inside one of those terminal windows where you can type commands, while you AREN’T running irb. You know you are are inside irb or not because it says “irb” inside the terminal window.

Now it’s time to practice!

Only reading this is not enough, you don’t become a great pianist by only reading books about music, you have to actually play the piano.

Same thing applies for any other skill.

Now.

Try these math operations:

Feel free to play around with your own ideas, and don’t worry if you see an error message or two.

Ruby Programming Language

There is A LOT of learning ahead & things will become more clear over time.

Examples

Remember:

It takes time & effort to develop a new skill!

Also I want you to close your terminal window, open it again, open irb & type more math.

Do that a few times so you’ll remember how to do it the next time.

Ruby Programming Language

By Satish Talim

RubyLearning.com is a thorough collection of Ruby Study Notes for those who are new to the Ruby programming language and in search of a solid introduction to Ruby's concepts and constructs.

Speed up your Ruby programming learning process by joining 1000s of other would-be Ruby developers around the globe at the Online RubyLearning Class. Step through the convenient lessons related to 'Ruby' and post your Ruby-related queries, questions and the RubyLearning team shall explain and solve them for you.

The Ruby eBook contains all the Core Ruby topics covered on this site. The eBook covers Ruby 2, is over 240 pages and is in pdf format. The cost of this eBook is only a nominal US$ 9.95 and is being collected to help us maintain the site and the eBook, and also provide quality content to you. Click to buy the Ruby eBook now.

Ruby Programming Language

In a hurry to get started? Why wait? Dive in to Learn Ruby.

My interest in Ruby was aroused after I read an article 'Ruby the Rival' in November 2005. I started learning Ruby myself and made my own Ruby Study Notes. What's presented here is my Free Ruby Programming Guide for you.

Ruby Programming Language Tutorial

If you find this Ruby Guide useful, I would like to hear your comments and suggestions. Also email me at satish [at] rubylearning [dot] com your details like name, city, country, photo and email id and I would put it up on my Testimonials page.
If you notice any errors or typos, or have any comments or suggestions or good exercises I could include, or have any queries on any of the topics here, please email at satish [at] rubylearning [dot] com.
Good luck and I hope you find this site useful!

I'd like to thank everyone on the ruby-talk mailing list for their thoughts and encouragement; all of my wonderful PuneRuby RUG members, for their help in making these Ruby Study Notes far better than I could have done alone. I would like to specially thank Andy Tyrrell from UK, for his help in tweaking the Syntax Highlighter css.

Note: The Ruby Logo is Copyright (c) 2006, Yukihiro Matsumoto. I have made extensive references to information, related to Ruby, available in the public domain (wikis and the blogs, articles of various Ruby Gurus), my acknowledgment and thanks to all of them. Much of the material on rubylearning.com and in the course at rubylearning.org is drawn primarily from the Programming Ruby book, available from The Pragmatic Bookshelf.