README.md 1.7 KB
Newer Older
A
Akash Manohar J 已提交
1 2
# asdf-ruby

3 4
[![Build Status](https://travis-ci.org/asdf-vm/asdf-ruby.svg?branch=master)](https://travis-ci.org/asdf-vm/asdf-ruby)

A
Akash Manohar 已提交
5
Ruby plugin for [asdf](https://github.com/asdf-vm/asdf) version manager
A
Akash Manohar J 已提交
6 7 8 9

## Install

```
A
Akash Manohar 已提交
10
asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
A
Akash Manohar J 已提交
11 12 13 14
```

## Use

A
Akash Manohar 已提交
15
Check [asdf](https://github.com/asdf-vm/asdf) readme for instructions on how to install & manage versions of Ruby.
16 17 18 19 20

When installing Ruby using `asdf install`, you can pass custom configure options with the following env vars:

* `RUBY_CONFIGURE_OPTIONS` - use only your configure options
* `RUBY_EXTRA_CONFIGURE_OPTIONS` - append these configure options along with ones that this plugin already uses
21

22 23 24 25 26 27 28 29 30 31 32 33
## Default gems

asdf-ruby can automatically install a set of default gems right after
installing a Ruby version. To enable this feature, provide a
`$HOME/.default-gems` file that lists one gem per line, for example:

```
bundler
pry
gem-ctags
```

34 35 36 37 38
## Migrating from another Ruby version manager

### `.ruby-version` file

asdf uses the `.tool-versions` for auto-switching between software versions.
R
Rick Liu 已提交
39
To ease migration, you can have it read an existing `.ruby-version` file to
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
find out what version of Ruby should be used. To do this, add the following to
`$HOME/.asdfrc`:

    legacy_version_file = yes

### Rubies

asdf installs Rubies to `$HOME/.asdf/installs/ruby`, the directory structure is
the same as other version managers, so you can just move the Rubies to this
directory:

#### RVM

    mkdir ~/.asdf/installs/
    mv ~/.rvm/rubies ~/.asdf/installs/ruby/

#### rbenv

    mkdir ~/.asdf/installs/
    mv ~/.rbenv/versions ~/.asdf/installs/ruby/

#### chruby

    mkdir ~/.asdf/installs/
    mv ~/.rubies ~/.asdf/installs/ruby/