jmsevillam / ruby-course

An introduction to Ruby

Home Page:https://lab.github.com/everydeveloper/introduction-to-ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set up your environment

github-learning-lab opened this issue Ā· comments

Hey there!

Today we will be learning the basics of Ruby. Ruby is a flexible and dynamic language, developed to feel natural and simple (some even call it beautifulšŸ’Ž). It is open source, and widely popular with the Rails framework.

Today, I'm going to guide you through your first Ruby project. First, we will write a program to output "Hello world" (as software developers are known to do). Then, we will learn some ruby methods to collect user input. Lastly, we will display different statements based on their input.

This is an interactive course, where you will be prompted to do something to finish each step. If it takes more than a few seconds for a response, try refreshing your browser.

Leave a comment with your name to continue

Mauricio Sevilla

Alright Mauricio Sevilla, before we dive into the tutorial, there are a couple of steps to set up our work environment.

  • Install Ruby onto our machine
  • Check that Git is installed
  • Clone this project repository onto our machine
  • Install a text editor onto our machine

Install Ruby

You might not need to install Ruby on your machine if it is already installed. You can figure that out by opening up your command line and typing:

ruby -v

If you see a Ruby version, then you're good to go. If you don't see a Ruby version, then you'll need to install Ruby for your machine.

Check that Git is Installed

You can check if Git is installed in a similar way. Type the following into your command line:

git --version

If you see a Git version, you're all set. If you don't see a Git version, then you'll need to install Git for your operating system.

Clone the Repository

Now that we've got Ruby and Git installed, we're going to clone this repository from GitHub so we can make changes.

Open your console and navigate to the folder you want to work in, then enter:

git clone https://github.com/jmsevillam/ruby-course.git

You should see a folder called ruby-course on your desktop, and inside that folder you'll see three files:

  • hello.rb ā€“ the first file we'll be working with where we go over both how to output strings and receive and use input from the user.
  • montys-color.rb ā€“ the second file we'll be working with where we expand on the concepts of the first file by adding in our conditional statements, If/Else, to better control the output.
  • README.md ā€“ a markdown introduction to this tutorial.

Install a Text Editor

Most machines come with a basic text editor that you can use to get started, though I recommend installing an editor that is a bit more robust. Some popular ones are Atom, VS Code, and Sublime Text.

With all that installed, we have what we need to begin writing our Ruby program!

Close this issue for the next step

Great, you are ready to start coding in Ruby!

Click here to get started.