Hello World with Ruby

We’re all hyped up and ready to just start coding. You’ve waited all your life and the moment is finally here. You’ll definitely be the next Bill Gates of this generation. Then, a brick wall just appears out of nowhere – the Terminal. Many people are afraid of using the terminal but do not worry! It’s just a place where you type in the commands.

The Terminal
The Terminal

You have no clue what those symbols are and the fat blinking cursor doesn’t help at all. I’ve clicked that exit more times that you could imagine. It’s too foreign and you simply can’t deal with this unfamiliar madness.

You have to start somewhere though. It doesn’t have to be as grand as creating a website out of nowhere in a blink of an eye nor does it have to be perfect. It could be as simple as learning how to print a short string such as “Hello World” using Ruby and that’s what we’re going to do today.

Here are the step-by-step instructions on how to print a simple set of strings using Ruby:

1. Open your Terminal by using ‘Search’ on your Mac

2. Type ‘irb‘ without the quotes then press ENTER

3. Type ‘puts “Hello World”‘ then press ENTER

Hello World

… and there you have it!

We just typed irb to run the Interactive Ruby Shell. Here we can run our Ruby scripts such as printing Hello World. It is that easy to get started with Ruby!

Stay tuned for more tutorials!

Leave a Reply

Your email address will not be published. Required fields are marked *