rbenv is Ruby version management and virtual environment.
We can install multiple Ruby version and switch easily.
I tried in Ubuntu 15.10
To work with rbenv, we need to install rbenv and rubybuild
git clone https://github.com/rbenv/rbenv.git ~/.rbenv git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
Check out current version in ~/.rbenv, and ~/.rbenv/plugins/ruby-build
We need some settings for them.
Add following description to ~/.bashrc
export PATH=$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH eval "$(rbenv init -)"
We can use rbenv command
Version check(rbenv version)
Before installation, check ruby version list we can install
rbenv install -l
Install version 2.3.0
rbenv install 2.3.0
It takes a lot of time to compile and install.
If failed, some dependencies are missing, please follow instructions.
Set Global environment
rbenv global 2.3.0
We can switch ruby version per directly.
If you want to use special version under the directory, use local
rbenv local 2.1.0
Use 2.1.0 under this directory.