tutorial net
*********WOOOOOOW *********
We're happy to see you're enjoying our races (already 5 pages viewed today)! You can keep checking out by becoming a member of the tutorial net community. It's free!

You will also be able to keep track of your race progress, practice on exercises, and chat with other members.

Go down
Posts : 200
Join date : 2017-11-11
Age : 27
Location : algeria
View user profilehttp://www.tutorial-net.com

tutorial ruby -Install Ruby

on Sun Apr 01, 2018 3:58 pm
Install your tools
Ready to embark on the world of happy Ruby coders?  

Start by providing you with the basic tools that I will present here to code wonders!  :magician:

First things first: the console and the text editor
First of all, you will need to use 2 tools throughout this course:

1st tool: a console (mainly to execute Ruby code)
You have one already installed on your machine, it will be different depending on your OS (Mac, Linux, Windows ...) but the basic commands will be substantially the same.

How to find the console?

On Mac, you can find it in Applications> Utilities> Terminal.

On Windows, tap cmd in the search box and then tap or click "Command Prompt."

On Linux, I invite you to consult  these instructions  in the Ubuntu documentation to know the procedure according to your version.

2nd tool: A text editor (to write Ruby code)
In this course, I will use Vim, but you can choose any other publisher you prefer!

If you're not familiar with these tools, do not worry, I'm not going to ask you to be an expert: you'll just need some basics to be able to do simple actions with. For that, I invite you to consult the introductions to  the console and to the text editor  of my course on Git.

And now, let's install the most important tool of this course: Ruby!
Install Ruby
We are going to install the version 2.2.0 of Ruby that we will use in this course.

Note that versions between 2.0.0 and 2.2.0 work properly, and future versions of Ruby are unlikely to radically change the syntax. So if you already have version 2.0.0 or later, it will work just as well!

Mac OS
Check your version of Ruby
It turns out that Ruby is installed base on Mac OS. By cons you may not have the right version. To check the version, launch the "Terminal" application that you can find in the "Utilities" folder of your Applications or by doing a search with spotlight.
[You must be registered and logged in to see this image.]

Once your Terminal is running, type the following command:

ruby -v
If you have a version after 2.0.0, everything is fine, you can move on! On the other hand, if you have an older version, you will have to do the following actions.

Update your version if needed
First, install homebrew , which is a package manager that will allow us to install the rest of our tools. To do this, type in the console:
ruby -e "$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
During the installation, you will be asked to type your session password. Do not worry, it's just a simple check to move on to the next step.

Then we will use the command brew to install rbenv, a solution to manage multiple versions of Ruby:

brew install rbenv ruby-build
echo 'if which rbenv> / dev / null; then eval "$ (rbenv init -)"; fi '>> ~ / .bashprofile
source ~ / .bashprofile
Finally, you will be able to use rbenv to install version 2.2.0 of Ruby:

rbenv install 2.2.0
rbenv global 2.2.0
You can verify that you have the correct version of Ruby by running the same command as before:
ruby -v
If all went well, the console should return you version 2.2.0.

It is possible that Ruby is already installed under your Linux distribution. Verify that you have a version greater than 2.0.0 by running the following command in a console:
If you get an error or version number earlier than 2.0.0, install Ruby version 2.2.0 by following the appropriate procedure for your distribution .

Go to Ruby Installer  to download the latest version of Ruby. The site will provide you with a file .exe , launch it and follow the instructions that will be given to you!

During the installation, remember to check "Add Ruby executables to your PATH" in order to use the Ruby commands in your terminal:

Back to top
Permissions in this forum:
You cannot reply to topics in this forum