1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 15:53:45 -05:00

Use mdtoc for the readme

This commit is contained in:
Sam Stephenson
2011-08-11 14:21:15 -05:00
parent 7c8da88df6
commit 066d63c0df
4 changed files with 334 additions and 37 deletions

View File

@@ -36,7 +36,18 @@ tools that do one thing well.
of executing arbitrary code, rbenv reads just the version name
from each project. There's nothing to "trust."
## How It Works
* [1 How It Works](#section_1)
* [2 Installation](#section_2)
* [3 Usage](#section_3)
* [3.1 set-default](#section_3.1)
* [3.2 set-local](#section_3.2)
* [3.3 versions](#section_3.3)
* [3.4 version](#section_3.4)
* [3.5 rehash](#section_3.5)
* [4 Contributing](#section_4)
* [4.1 License](#section_4.1)
## <a name="section_1">1</a> How It Works
rbenv operates on the per-user directory `~/.rbenv`. Version names in
rbenv correspond to subdirectories of `~/.rbenv/versions`. For
@@ -56,7 +67,7 @@ and then execute the corresponding binary.
Because of the simplicity of the shim approach, all you need to use
rbenv is `~/.rbenv/shims` in your `$PATH`.
## Installation
## <a name="section_2">2</a> Installation
rbenv is a young project, so for now you must install it from source.
@@ -103,55 +114,62 @@ when installing a gem that provides a binary).
$ rbenv rehash
## Usage
## <a name="section_3">3</a> Usage
Like `git`, the `rbenv` command delegates to subcommands based on its
first argument. The most common subcommands are:
* **set-default** — sets the default version of Ruby to be used in all
shells by writing the version name to the `~/.rbenv/default`
file. This version can be overridden by a per-project
`.rbenv-version` file, or by setting the `RBENV_VERSION`
environment variable.
### <a name="section_3.1">3.1</a> set-default
$ rbenv set-default 1.9.2-p290
Sets the default version of Ruby to be used in all shells by writing
the version name to the `~/.rbenv/default` file. This version can be
overridden by a per-project `.rbenv-version` file, or by setting the
`RBENV_VERSION` environment variable.
The special version name `system` tells rbenv to use the system
Ruby (detected by searching your `$PATH`).
$ rbenv set-default 1.9.2-p290
* **set-local** — sets a local per-project Ruby version by writing the
version name to an `.rbenv-version` file in the current
directory. This version overrides the default, and can be
overridden itself by setting the `RBENV_VERSION` environment
variable.
The special version name `system` tells rbenv to use the system Ruby
(detected by searching your `$PATH`).
$ rbenv set-local rbx-1.2.4
### <a name="section_3.2">3.2</a> set-local
* **versions** — lists all Ruby versions known to rbenv, and shows an
asterisk next to the currently active version.
Sets a local per-project Ruby version by writing the version name to
an `.rbenv-version` file in the current directory. This version
overrides the default, and can be overridden itself by setting the
`RBENV_VERSION` environment variable.
$ rbenv versions
1.8.7-p352
1.9.2-p290
* 1.9.3-preview1 (set by /Users/sam/.rbenv/default)
jruby-1.6.3
rbx-1.2.4
ree-1.8.7-2011.03
$ rbenv set-local rbx-1.2.4
* **version** — displays the currently active Ruby version, along with
information on how it was set.
### <a name="section_3.3">3.3</a> versions
$ rbenv version
1.8.7-p352 (set by /Volumes/37signals/basecamp/.rbenv-version)
Lists all Ruby versions known to rbenv, and shows an asterisk next to
the currently active version.
* **rehash** — installs shims for all Ruby binaries known to rbenv
(i.e., `~/.rbenv/versions/*/bin/*`). Run this command after you
install a new version of Ruby, or install a gem that provides
binaries.
$ rbenv versions
1.8.7-p352
1.9.2-p290
* 1.9.3-preview1 (set by /Users/sam/.rbenv/default)
jruby-1.6.3
rbx-1.2.4
ree-1.8.7-2011.03
$ rbenv rehash
### <a name="section_3.4">3.4</a> version
## Contributing
Displays the currently active Ruby version, along with information on
how it was set.
$ rbenv version
1.8.7-p352 (set by /Volumes/37signals/basecamp/.rbenv-version)
### <a name="section_3.5">3.5</a> rehash
Installs shims for all Ruby binaries known to rbenv (i.e.,
`~/.rbenv/versions/*/bin/*`). Run this command after you install a new
version of Ruby, or install a gem that provides binaries.
$ rbenv rehash
## <a name="section_4">4</a> Contributing
The rbenv source code is [hosted on
GitHub](https://github.com/sstephenson/rbenv). It's clean, modular,
@@ -160,7 +178,7 @@ and easy to understand, even if you're not a shell hacker.
Please feel free to submit pull requests and file bugs on the [issue
tracker](https://github.com/sstephenson/rbenv/issues).
## License
### <a name="section_4.1">4.1</a> License
(The MIT license)