You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.mkd
+43-10Lines changed: 43 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ a.k.a. "How To Ask Questions The Smart Way"
27
27
*[Homebrew](#homebrew)
28
28
*[Special note for RubyMine users](#special-note-for-rubymine-users)
29
29
*[Usage](#usage)
30
+
*[Usage (the advanced, "neckbeard" version](#usage-the-advanced-neckbeard-version)
30
31
*[How to Report Issues](#how-to-report-issues)
31
32
*[History](#history)
32
33
*[License](#license)
@@ -57,9 +58,10 @@ If you want to use [Homebrew](http://github.com/Homebrew/homebrew) (Mac OS X):
57
58
58
59
## Usage
59
60
60
-
``rbenv gemset`` command will gives you the following usage:
61
61
62
-
rbenv-gemset [command] [options]
62
+
Running ``rbenv gemset`` will give you the following help:
63
+
64
+
rbenv gemset [command] [options]
63
65
64
66
possible commands are:
65
67
active
@@ -75,25 +77,56 @@ Here is a basic example:
75
77
```shell
76
78
cd my-project
77
79
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.
81
83
rbenv gemset init
82
84
83
85
# To create a gemset under a specific ruby version:
84
86
rbenv gemset create [version] [gemset]
85
87
86
-
# You can see the existing gemset by using the following command:
88
+
# You can list the existing gemsets by using the following command:
87
89
# This should include the most recent gemset you just created.
88
90
rbenv gemset list
89
91
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]
92
94
```
93
95
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.
95
96
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
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.
0 commit comments