How to Install Ruby

Jordan Hudgens
A free video tutorial from Jordan Hudgens
CTO at Bottega Code School
4.4 instructor rating • 16 courses • 67,656 students

Learn more from the full course

Comprehensive Ruby Programming

Learn how to program in the Ruby programming language, starting from scratch and moving to advanced coding techniques.

11:02:36 of on-demand video • Updated April 2021

  • Build programs in the Ruby programming language
  • Know how to work with the Ruby syntax
  • Create custom algorithms
  • Work with loops and iterators
  • Learn object oriented programming
  • Work with OOP inheritance
  • Start building real life programs in Ruby
English [Auto] OK before we can start using Ruby and building Ruby programs we first have to get Ruby on your system. So I'm going to walk you through how to do it regardless of what operating system you have. And I'm also going to give you an alternative if you don't want to install it on your system right now and that's totally fine. So if you go to Ruby Dasch laying dot org you'll see this page right here. Or you could just type in Ruby programming language and it will be the first one that pops up. This is the official Ruby site and you can click download Ruby and it will also give you your different options based off of what operating system you're on. If you're on ruby then you're going to want to come to root if you're on Windows. You can go to Ruby installer dot org and if you come here. Well the actual home page will look like this. Just click download and then pick out the version you want and any of these any one of two will be perfectly fine I'd probably suggest either to 1 7 or 2 to 3 and make sure to pick out if you have 64 bit operating system and that kind of thing. So pick that out run the installer It'll do everything for you and you'll be ready to go if you're on a Mac. You actually already have Ruby installed on it and I'll show you. You could do something like this where you create a ruby file so I created one that says Do I have Ruby with underscores separating each of the words. And I just wrote puts Yes you have Ruby right here and then open up a terminal session and make sure you're in the same. Make sure you're in the same directory so type in class and you can see do I have Ruby is a file I have right there. And if you have Ruby on your system just type in Ruby and then the file name hit return and is as yes you have Ruby which means what it did is it just ran that Ruby program. So that's how to if you have a Mac you already have access to it. Now one thing though that you can do on Mac and Linux that you may find handy is using a system like our VM which is stands for Ruby version manager so you may want to use it on some projects use one type of version and on another project use a different version that's pretty common with different projects you build. Now if you go through the instructions here to install our VM these are all just commands that you can copy and paste right into the command line. I'm not going to do it because I already have it installed but once you do have it installed you can do something like our VM list and it shows right here all of the different Ruby versions that are on my current system. And so if I want to change to another one I can say RBM. See I'm use to point to and what Ill do is Ill go to that version and see here it says. Now I'm using this version. Not a huge difference. You don't really have to worry about this right now but as you do start to build out bigger and more applications I should say that's where it usually comes into play as all have one application that uses version 2.1 7 and another one that uses 2.1 to and I'll have to switch between the two of them. And so that's say that's something you'll find as you take on more projects so you don't have to worry about now but it is important to know and it's very easy to add and control right from the terminal right here. So that's of you're on a Mac or on a Linux you have the same unix shell so you can do the same thing. But if you're on either of those you can start the course right away. It's going to be built in. And the last thing is if you don't really feel like installing the system you just want to start diving in the code that is totally fine. You can come to this site REPL it R E P L Dot T and pick out. Well you can bug out any language but for this course pick out Ruby and it actually gives you a full terminal session right here and will render all of the Ruby code. So if I do puts runnin Ruby from the browser and hit run you can see right over here it printed out exactly like this was a ruby file. And we ran Ruby just like I did a second ago from the terminal. So if you want to just dive right in and jump and start building some code and running some programs you can use this. I actually even though I have a ruby on my system there's a lot of times all pop rebel open because I really like this interface and I like being able to see the terminal right next to it. So if I have a kind of confusing algorithm or I have some buggy code there's a bunch of times I'll copy and paste my program right in here so that I can see it side by side. And it also gives some good error messages. So that's how you install it on your system and that covers. Windows Mac Linux and none of the above. If you want to just use REPL for for a browser based environment. So now that you have that will get into a few more things discussing the language and also how to install a different version of Ruby on your system if you have. If you have our VM.