First install the dependency crap. I am using Ubuntu 20.4 and 22.
1
sudo apt update
1
2
3
sudo apt install git curl autoconf bison build-essential \
libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
Next stop, grap that line and smack it into to your shell. This will donwload stuff, does some other stuff.
1
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
When this finishes, you’ll have to paste this lines into your shell of love.
1
2
3
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
Guess what, it’s time to install a ruby version of your choice. List all given versions like this.
1
rbenv install -l
However, I’ve installed 3.2.2 for my jekyll stuff like this.
1
2
rbenv install 3.2.2
rbenv global 3.2.2
That is all about it.