dnf install git
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
ruby-build is an rbenv plugin that provides an rbenv install command to compile and install different versions of Ruby on UNIX-like systems.
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
Never run rbenv rehash again. This rbenv plugin automatically runs rbenv rehash every time you install or uninstall a gem.
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
dnf install gcc-c++ openssl-devel readline-devel bzip2
rbenv install -l
time rbenv install -v 2.5.1
rbenv global 2.5.1
rbenv local 2.5.1
ruby -v