This is an old revision of the document!
Install rbenv and Dependencies
First, update your package list
sudo apt update
Next, install the dependencies required to install Ruby:
sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libmysqlclient-dev libgdbm-dev
if anything breaks the installation, remove the particular dependency and install the other packages Once the dependencies download, you can install rbenv itself. Clone the rbenv repository from GitHub into the directory ~/.rbenv
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
Next, add ~/.rbenv/bin to your $PATH so that you can use the rbenv command line utility. Do this by altering your ~/.bashrc file so that it affects future login sessions:
echo 'export PATH=“$HOME/.rbenv/bin:$PATH”' » ~/.bashrc
Then add the command eval “$(rbenv init -)” to your ~/.bashrc file so rbenv loads automatically:
echo 'eval “$(rbenv init -)”' » ~/.bashrc
Next, apply the changes you made to your ~/.bashrc file to your current shell session:
source ~/.bashrc
Verify that rbenv is set up properly by using the type command, which will display more information about the rbenv command:
type rbenv
Your terminal window will display something starts with rbenv is a function