How to Install rbenv on Centos/Ubuntu?

How to Install rbenv on Centos/Ubuntu?

Rbenv provides an easy way to install and manage various versions of Ruby on your machine. We can install multiple versions of Ruby and set preferred one as the default version. This will help you ensure that the Ruby version you are developing against matches your production environment. In this article we will explain how to install “rbenv” on Centos machine and manage ruby using rbenv

How to Install Rbenv on Centos/Ubuntu?

On Centos, Run the following command to install rbenv  dependencies

Now we can install rbenv, easiest way do do this is by cloning the github repository

Make sure you run this commands as the user which will be running Ruby applications

This installs rbenv into your home directory, and sets the appropriate environment variables.

Now let us see how to install ruby using rbenv

How to install Ruby using rbenv?
First find out which version of Ruby you want to install . In this example, we will install Ruby 2.3.0

To Uninstall a ruby version, run following command

Following command will list the list of Ruby versions installed on the machine

Following commands are available for rbenv,

Please let me know if you face any troubles. Always happy to help ????

Leave a Reply

Your email address will not be published. Required fields are marked *