Before you begin, you should ensure that your build environment has the proper
system dependencies for compiling the wanted Ruby version (see our [recommendations](https://github.com/rbenv/ruby-build/wiki#suggested-build-environment)).
### Using `rbenv install` with rbenv
To install a Ruby version for use with rbenv, run `rbenv install` with the
exact name of the version you want to install. For example,
rbenv install 2.2.0
### Basic Usage
Ruby versions will be installed into a directory of the same name under
`~/.rbenv/versions`.
To see a list of all available Ruby versions, run `rbenv install --list`. You
may also tab-complete available Ruby versions if your rbenv installation is
properly configured.
```sh
# As an rbenv plugin
$ rbenv install--list# lists all available versions of Ruby
$ rbenv install 2.2.0 # installs Ruby 2.2.0 to ~/.rbenv/versions
### Using `ruby-build` standalone
# As a standalone program
$ ruby-build --definitions# lists all available versions of Ruby
$ ruby-build 2.2.0 ~/local/ruby-2.2.0 # installs Ruby 2.2.0 to ~/local/ruby-2.2.0
```
If you have installed ruby-build as a standalone program, you can use the
`ruby-build` command to compile and install Ruby versions into specific
locations.
ruby-build does not check for system dependencies before downloading and
attempting to compile the Ruby source. Please ensure that [all requisite
libraries][build-env] are available on your system.
Run the `ruby-build` command with the exact name of the version you want to
install and the full path where you want to install it. For example,
### Advanced Usage
ruby-build 2.2.0 ~/local/ruby-2.2.0
#### Custom Build Definitions
To see a list of all available Ruby versions, run `ruby-build --definitions`.
If you wish to develop and install a version of Ruby that is not yet supported
by ruby-build, you may specify the path to a custom “build definition file” in
place of a Ruby version number.
Pass the `-v` or `--verbose` flag to `ruby-build` as the first argument to see
what's happening under the hood.
Use the [default build definitions][definitions] as a template for your custom
definitions.
### Custom definitions
#### Custom Build Configuration
Both `rbenv install` and `ruby-build` accept a path to a custom definition file
in place of a version name. Custom definitions let you develop and install
versions of Ruby that are not yet supported by ruby-build.
The build process may be configured through the following environment variables:
See the [ruby-build built-in definitions][definitions] as a starting point for