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 |
{: .-three-column}
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
.
Command | Description |
---|---|
rbenv global 2.2.2 |
Use Ruby 2.2.2 globally |
rbenv global --unset |
Undo above |
Global version numbers are stored in ~/.rbenv/version
.
Command | Description |
---|---|
rbenv shell 2.2.2 |
Use Ruby 2.2.2 in shell |
rbenv shell --unset |
Undo above |
Shell-local version numbers are stored as environment variables.
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️