How To Program In Ruby Free Tutorial: 1. Introduction & Installation

Let's Learn To Code In Ruby!
In this tutorial I'll walk you thru the basics of coding in the Ruby programming language! Ruby is a very popular language to learn because it powers Ruby on Rails...one of the most popular frameworks for building powerful websites!
My Name is John Elder and I run the website Codemy.com where over 15,000 students have learned to code. Check it out! Use coupon code elder to get a massive discount if you'd like to join us!
This tutorial will be made up of a series of posts. There's just no way I could teach you Ruby programming in one quick article so I had to break it up. When I'm done, I'll post a table of contents linking all the posts together. In the mean time, you can follow me and check my Steemit blog for individual tutorial posts in the series.
Section 1: Setting Up A Development Environment
So you want to code Ruby, where do you start? There are many cloud development environments out there that you can use. Some are easier to use than others. The problem with them is that they come and go. I hate to be dependent on a third party if I don't have to. So we're going to download the tools you'll need straight to your computer.
Basically you're going to need a copy of the Ruby programming language, and a text editor of some sort. I'm going to assume that you're on a Windows computer (if you're on a mac, there's a good chance you have Ruby installed already and don't even know it).
Choosing a Text Editor
There are many free and paid text editors you can use. You don't want to use something like Microsoft Word because that adds formatting that can mess things up. You want to use a text editor specifically designed for writing code because it will have all sorts of features that you'll need. Things like, highlighting your code with different colors and things like that.
I recommend one of two free text editors: Sublime Text or Notepad++ Either one will work just fine, but I recommend Sublime Text. It's more popular. There are dozens of other text editors to choose from, so if you already have one that you like - feel free to use it!

Above is a picture of Sublime Text. You can see it has dark colors (which I like - though I'm sure you can easily change the color scheme if you like), and notice how the code is different colors? That *really* helps keep code straight. Below is a picture of Notepad++. You'll notice it is lighter in color (though again, you can easily change the color). Both editors work well, but I do recommend Sublime. It's just cooler!

Head over to either of their web sites and download and install one of the editors. They're both straight forward. Click the download link, download the file, once it's downloaded - double click it to install. Follow the prompts if there are any. Piece of cake. After that we need to...
Download and Install Ruby
To download Ruby, we need to get a Windows installer. You can find it for free at RubyInstaller.org and the site looks a little something like this...

Click the big red Download button to download the installer. That will bring you to the page where you need to determine which version of Ruby you want to download. This can get a little tricky! On the screen below, look on the right hand side of the screen and read that bit of text there. It will tell you what the current stable version of Ruby is. In this case, it appears to be 2.4.x (though that may change by the time you read this guide).

So this is interesting! On the right hand side it says that 2.4.x is the latest version, but on the left side where it lists all the files to download, the 2.4.x versions have (x64) or (x86) next to them (no 32 bit version), and I tend to stay away from those (you can use them if you want). I would probably recommend that you download 2.3.3. But that's only step one!
Step two is downloading the Development Kit. Scroll down the page to read about that. The version of Ruby that you download will determine the version of the Development Kit that you download. You can read all about it on that right hand side of the page. In our case, since we downloaded Ruby 2.3.3 (which is a 32-bit version), we need to download the first listed Dev Kit link (DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe). Yes, you and I are probably on 64-bit machines, but we downloaded the 32-bit version...just because. I just always do that. For no real reason that I can explain without looking crazy.

But this will likely all change by the time you read this tutorial, so be sure to read all that stuff on the right hand side of the page because it will tell you which things to download. There's a section headed "WHICH DEVELOPMENT KIT?" that you're gonna want to read.
Install Ruby First Then The Dev Kit After...
So choose which version of Ruby you want to download, we're going with 2.3.3 here and click the link. Save it to your computer then click the downloaded file to install it. You'll get a bunch of prompts. Most of them are obvious..until you get to this one...

There are three check boxes, and they will probably all be unchecked by default. You want to click the bottom two like I've done in the picture above so that there's a little check mark next to them. After you've clicked those two bottom check boxes, click the install button and continue on with the installation.
Install The Development Kit...
Once you've installed Ruby, it's time to install the development kit. Head back to the page we were just on and click the link that I just pointed out. You'll download the file to your computer, then click on it to install it (once it finishes downloading). Just like with Ruby, we can just go with the defaults until we see this screen...

Here, we want to replace whatever is in there by default with C:\DevKit which stands for Development Kit. It's just easier to remember that's where it is, and we're gonna have to type that into our Windows command prompt in just a second here...
Once you install the Dev Kit, we need to open a Windows Command Prompt and turn it on. To open a Windows Command Prompt, click the Windows button in the corner of your screen, and type cmd into the search thingy. Once in there you want to type these three commands: (hit enter on your keypad after each one)
Type Each Of These Commands Into The Prompt
- cd \DevKit
- ruby dk.rb init
- ruby dk.rb install

The first command switches us into the directory where our Development Kit is sitting. The second command initialized the files, and the third command installs the Development Kit. Be sure to hit enter on your keypad after you type in each command.
And That's It!!!
You're now ready to rock and roll! You now have all the tools you need downloaded and installed and ready to go. There's nothing left to do but start coding! We'll start right into that in the next tutorial...
Conclusion
So to sum up. We first selected and installed a text editor which we'll use to actually write all of our Ruby code throughout the rest of this tutorial. I recommended the Sublime Text Editor, but you're free to use any programming text editor that you like (Notepad++ is a nice alternative but there are dozens more to choose from). Next we downloaded and installed the Ruby Installer for Windows and the Development Kit as well. Finally, we initialized and installed the Development kit from the Windows Command Prompt.
In the next Tutorial we'll dive in and start writing Ruby code! See you then...

I hope you enjoyed this post! Comment below and let me know if you like these sorts of posts and I'll keep making them! And follow me - I follow back!
-John Elder
My Site: Learn To Code at Codemy.com
Facebook | Twitter | Instagram | Blog
