Skip to content

Commit aa04bb4

Browse files
committed
Close up #76: tidy up README; save neckbeard info!
1 parent 473ae9e commit aa04bb4

File tree

1 file changed

+43
-10
lines changed

1 file changed

+43
-10
lines changed

README.mkd

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ a.k.a. "How To Ask Questions The Smart Way"
2727
* [Homebrew](#homebrew)
2828
* [Special note for RubyMine users](#special-note-for-rubymine-users)
2929
* [Usage](#usage)
30+
* [Usage (the advanced, "neckbeard" version](#usage-the-advanced-neckbeard-version)
3031
* [How to Report Issues](#how-to-report-issues)
3132
* [History](#history)
3233
* [License](#license)
@@ -57,9 +58,10 @@ If you want to use [Homebrew](http://github.com/Homebrew/homebrew) (Mac OS X):
5758

5859
## Usage
5960

60-
``rbenv gemset`` command will gives you the following usage:
6161

62-
rbenv-gemset [command] [options]
62+
Running ``rbenv gemset`` will give you the following help:
63+
64+
rbenv gemset [command] [options]
6365

6466
possible commands are:
6567
active
@@ -75,25 +77,56 @@ Here is a basic example:
7577
```shell
7678
cd my-project
7779

78-
# Setup gemset for your project.
79-
# Also will create a .rbenv-gemset file in the current directory.
80-
# NOTE: this will create gemset under the $RUBY_VERSION.
80+
# Set up a default gemset for your project.
81+
# Also will create a `.rbenv-gemsets` file in the current directory.
82+
# NOTE: this will create the gemset under the current ruby version.
8183
rbenv gemset init
8284

8385
# To create a gemset under a specific ruby version:
8486
rbenv gemset create [version] [gemset]
8587

86-
# You can see the existing gemset by using the following command:
88+
# You can list the existing gemsets by using the following command:
8789
# This should include the most recent gemset you just created.
8890
rbenv gemset list
8991

90-
# You can delete the gemset with the following command:
91-
rbenv gemset delete [version] [gemset]
92+
# You can delete a gemset with the following command:
93+
rbenv gemset delete [version] [gemset]
9294
```
9395

94-
By default the rbenv-gemset init command will create the primary gemset, which is the project name, and it will initialize the directory under the ``$(rbenv prefix "$RBENV_VERSION")/gemsets/$RBENV_GEMSET``. If you are using the ``bundler`` it should install the gems and the dependencies in above path.
9596

96-
You can modify the content of .rbenv-gemsets so the gems will be installed in the project directory (for example .gems or ./gems)
97+
98+
## Usage (the advanced, "neckbeard" version)
99+
100+
101+
In your application directory, create a file named `.rbenv-gemsets`, with the
102+
names of the gemsets that you want to use on separate lines, or separated
103+
by whitespace. The first gemset in the list will be the primary gemset, where
104+
new gems will be installed.
105+
106+
$ echo -e "my-gemset\nanother-gemset" > .rbenv-gemsets
107+
108+
Now all commands involving gems will use the gemsets that you've specified.
109+
110+
To have gems install into a sub-folder in your project directory for easy removal later (`rm -rf project_dir`!) / editing / testing,
111+
you can use a project gemset. A project gemset has a '.' ("dot") as the first character:
112+
113+
$ echo '.gems' > .rbenv-gemsets
114+
115+
Your gems will then get installed in `project/.gems`.
116+
If you don't want to use a "dot directory" to house your gems but still want to use a project gemset,
117+
then do something like this instead:
118+
119+
$ echo './gems' > .rbenv-gemsets
120+
121+
Your gems will then get installed in `project/gems`.
122+
123+
To see your currently active gemsets, try `rbenv gemset active`. If you're wondering about that gemset called `global` at the end, see https://github.com/jf/rbenv-gemset/issues/59#issuecomment-38264174.
124+
**TL;DR:** if you don't have any actual gemset called `global`, forget about it! `global` will not affect you at all.
125+
If you just don't like seeing that `global` at the end, you can add a `-global` ("minus gemset") to your `.rbenv-gemsets` file.
126+
127+
The gemset plugin will cause rbenv to search for the `.rbenv-gemsets` file in
128+
the current directory, as well as in all ancestor directories, so as long as
129+
there is a `.rbenv-gemsets` file in or above the current directory.
97130

98131

99132
**Special environment variable tips and tricks**

0 commit comments

Comments
 (0)