8 A one-page guide to rbenv Ruby version manager, with usage examples and more.
10 [rbenv](https://github.com/rbenv/rbenv) lets you manage installations of multiple Ruby versions.
15 #### Install rbenv and ruby-build
18 git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
19 git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
22 #### Add to ~/.bash_profile
25 echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
26 echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
29 #### Verify installation
32 type rbenv # → "rbenv is a function"
35 These are generic instructions; there may be rbenv packages available for your OS.
37 See: [Installation](https://github.com/rbenv/rbenv#installation)
41 | Command | Description |
43 | `rbenv install -l` | List all available versions |
45 | `rbenv install 2.2.1` | Install Ruby _2.2.1_ |
46 | `rbenv uninstall 2.2.1` | Uninstall Ruby _2.2.1_ |
48 | `rbenv versions` | See installed versions |
49 | `rbenv version` | See current version |
51 | `rbenv which <NAME>` | Display path to executable |
52 | `rbenv rehash` | Re-write binstubs |
59 | Command | Description |
61 | `rbenv local 2.2.2` | Use Ruby _2.2.2_ in project |
62 | `rbenv local --unset` | Undo above |
64 Application-specific version numbers are stored in `.ruby-version`.
68 | Command | Description |
70 | `rbenv global 2.2.2` | Use Ruby _2.2.2_ globally |
71 | `rbenv global --unset` | Undo above |
73 Global version numbers are stored in `~/.rbenv/version`.
77 | Command | Description |
79 | `rbenv shell 2.2.2` | Use Ruby _2.2.2_ in shell |
80 | `rbenv shell --unset` | Undo above |
82 Shell-local version numbers are stored as environment variables.
86 - [rbenv project page](https://github.com/rbenv/rbenv) _(github.com)_
87 - [rbenv ubuntu server cheatsheet](https://gist.github.com/rahul286/7160839f4425a3b7e718) _(gist.github.com)_