rbenv lets you manage installations of multiple Ruby versions.
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
type rbenv # → "rbenv is a function"
These are generic instructions; there may be rbenv packages available for your OS.
See: Installation
Command | Description |
---|---|
rbenv install -l |
List all available versions |
rbenv install 2.2.1 |
Install Ruby 2.2.1 |
rbenv uninstall 2.2.1 |
Uninstall Ruby 2.2.1 |
rbenv versions |
See installed versions |
rbenv version |
See current version |
rbenv which <NAME> |
Display path to executable |
rbenv rehash |
Re-write binstubs |
Command | Description |
---|---|
rbenv local 2.2.2 |
Use Ruby 2.2.2 in project |
rbenv local --unset |
Undo above |
Application-specific version numbers are stored in .ruby-version
.