Primero actualizamos apt-get
$ sudo apt-get update
Instalamos las dependencias con apt-get
$ sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
Nos movemos al directorios raiz
$ cd ~
Clonamos y configuramos rbenv para nuestro entorno
$ git clone git://github.com/sstephenson/rbenv.git .rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
Clonamos el repositorio de versiones de ruby y lo cofiguramos para nuestro entorno
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profile
En ubuntu para escritorio reemplazar .bash_profile por .bashrc y si usa Ho My ZSH usar .zshrc
Ahora instalamos y configuramos la version de Ruby
$ rbenv install -v 2.4.3
$ rbenv global 2.4.3
ZSH
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
$ echo 'source $HOME/.zshenv' >> ~/.zshrc
$ exec $SHELL