$ brew install --HEAD ruby-build # installs the latest development release
$ brew upgrade --fetch-HEAD ruby-build # upgrades the HEAD package
To update ruby-build after it has been installed, run `git pull` in your cloned
copy of the repository, then re-run the install script.
## Usage
### Installing with Homebrew (for OS X users)
#### DEPENDENCY WARNING
Mac OS X users can install ruby-build with the [Homebrew](http://brew.sh)
package manager. This will give you access to the `ruby-build` command. If you
have rbenv installed, you will also be able to use the `rbenv install` command.
Due to the considerable variation between different systems, ruby-build does
not check for dependencies before downloading and attempting to compile the
Ruby source. Before using ruby-build, please [consult the
wiki](https://github.com/rbenv/ruby-build/wiki#suggested-build-environment) to
ensure that all the requisite libraries are available on your system.
Otherwise, you may encounter segmentation faults or other critical errors.
*This is the recommended method of installation if you installed rbenv with
Homebrew.*
### Basic Usage
brew install ruby-build
#### With rbenv
Or, if you would like to install the latest development release:
ruby-build extends rbenv with the subcommand `rbenv install`. To see which versions of Ruby it knows about, run:
brew install --HEAD ruby-build
$ rbenv install --list
To upgrade the HEAD package use `--fetch-HEAD` option:
To install one, call it again with the exact version name:
brew upgrade --fetch-HEAD ruby-build
$ rbenv install 2.2.0
## Usage
`rbenv install` supports tab completion (if rbenv is properly configured). Each Ruby version built in this way is installed to `~/.rbenv/versions`.
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)).
See `rbenv help install` for more.
### Using `rbenv install` with rbenv
#### As a standalone
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,
To see which versions of Ruby ruby-build knows about, run:
rbenv install 2.2.0
$ ruby-build --definitions
Ruby versions will be installed into a directory of the same name under
`~/.rbenv/versions`.
To install one, specify both the exact version name and the destination directory:
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.
$ ruby-build 2.2.0 ~/local/ruby-2.2.0
### Using `ruby-build` standalone
### Advanced Usage
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.
#### Custom Build Definitions
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,
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.
ruby-build 2.2.0 ~/local/ruby-2.2.0
Use the [default build definitions][definitions] as a template for your custom
definitions.
To see a list of all available Ruby versions, run `ruby-build --definitions`.
Pass the `-v` or `--verbose` flag to `ruby-build` as the first argument to see