It is available for macos linux and other unix like operating systems.
Install ruby ubuntu rbenv.
Ruby build can also be used as a standalone program without rbenv.
Ruby build is a plugin for rbenv that allows you to compile and install different versions of ruby.
Update the package index list by typing.
The reason we re going to be using ubuntu is because the majority of code you write will run on a linux server.
To install rbenv on your system run the below commands.
Rbenv install 2 5 1rbenv global 2 5 1.
If you are developing ruby applications and work multiple ruby environments then the preferred way is to install ruby using rbenv or rvm.
At this point you have both rbenv and ruby build installed.
Step 2 installing ruby with ruby build.
To list all available ruby versions you can use.
We ll now install a particular version of ruby.
If you are not sure which ruby version to install consult the documentation of the application you re going to deploy.
The below commands will install rbenv into your home directory and set appropriate environment variables.
First let s list all the available versions of ruby.
Copy the command below to install the packages and dependencies required to build ruby.
First let s list all the available versions of ruby.
Rbenv install l the output of that command should be a long list of versions that you can choose to install.
There are another ways to install ruby being the easiest to install the ubuntu version sudo apt get update sudo apt get upgrade sudo apt get install ruby full but in this guide we ll use the rbenv tool which is the most common these days because it is ligther than rvm which is another common way to install and maintain ruby on linux or.
Sudo apt update sudo apt install y yarn install ruby using rbenv recommended the rbenv lets you install and manage the versions of ruby easily and it is lighter than rvm.
Rbenv is a ruby version management tool that allows you to switch ruby versions easily.
Verify that ruby was properly installed by printing the version number.
Let s install ruby next.
With the ruby build plugin now installed you can install versions of ruby y may need through a simple command.
By default rbenv doesn t handle installing ruby versions so we also need to install ruby build that will help you to install specific version of ruby.
This will take about 30 minutes.
Installing ruby from ubuntu repositories.
Follow the below instruction as root or sudo user to install ruby with rbenv.
We will be setting up a ruby on rails development environment on ubuntu 18 04 bionic beaver.
Install ruby with rbenv.
With the ruby build rbenv plugin now installed we can install whatever versions of ruby that we may need through a simple command.