Update the package index list by typing.
Install ruby 2 5 ubuntu.
At the time of this writing the current stable releases of ruby are 2 6 3 and 2 5 5.
The reason we re going to be using ubuntu is because the majority of code you write will run on a linux server.
Install ruby with rbenv.
1 use ubuntu snap rather than apt it ll allow you to choose which version to install the latest or any prior one.
In this tutorial you ll set up a ruby programming environment on your local linux machine via the command line.
We will be setting up a ruby on rails development environment on ubuntu 20 04 focal fossa.
However you ll notice later in this guide that when we install ruby from apt the version is going to be a bit older 2 5 1p57.
Ruby language was created by yukihiro matz matsumoto and first published in 1995.
As the same user you can install the most recent version of rails with the gem install command.
While there are many ways to install ruby on ubuntu the easiest method is to use rvm the ruby version manager.
Rbenv is a ruby version management tool that allows you to switch ruby versions easily.
The output you receive will show you which version of ruby you have installed just like in the image below.
As you can see we have installed ruby version 2 5 1.
At the time of writing the version in the ubuntu repositories is 2 5 1 which is the latest stable version of ruby.
Install ruby by.
Press y and hit enter to verify the installation.
Ruby build is a plugin for rbenv that allows you to compile and install different versions of ruby.
It is available for macos linux and other unix like operating systems.
It will work perfectly fine in this case.
Follow the below instruction as root or sudo user to install ruby with rbenv.
However if we install with snap we ll get the latest stable release 2 6 3.
The easiest way to install ruby on your ubuntu system is through the apt package manager.
Ruby install allows you to compile and install different versions of ruby into arbitrary.
Ruby build can also be used as a standalone program without rbenv.
Ubuntu is one of the easiest linux distributions to use with lots of documentation so it s a great one to start with.
Step 1 install rvm.
First update the packages index.
It downloads the latest version of ruby and installs all of the prerequisite libraries.
Home sammy rbenv versions 2 5 0 lib ruby gems 2 5 0.
To check whether the installation was successful type in the command.
Rvm is the ruby version manager helps for installing and managing ruby language on systems.
Sudo apt install ruby full.
This article will help you to install ruby on rails on ubuntu and linuxmint linux systems using rvm.
Rails are the framework to run ruby language.