bundler 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- data/.gitignore +12 -0
- data/CHANGELOG.md +28 -6
- data/ISSUES.md +1 -1
- data/README.md +7 -5
- data/Rakefile +173 -0
- data/UPGRADING.md +103 -0
- data/bundler.gemspec +28 -0
- data/lib/bundler.rb +1 -0
- data/lib/bundler/capistrano.rb +2 -31
- data/lib/bundler/cli.rb +18 -16
- data/lib/bundler/deployment.rb +37 -0
- data/lib/bundler/dsl.rb +3 -3
- data/lib/bundler/gem_helper.rb +4 -7
- data/lib/bundler/graph.rb +3 -3
- data/lib/bundler/installer.rb +1 -0
- data/lib/bundler/lockfile_parser.rb +1 -1
- data/lib/bundler/man/bundle +1 -1
- data/lib/bundler/man/bundle-config +92 -0
- data/lib/bundler/man/bundle-config.txt +72 -30
- data/lib/bundler/man/bundle-exec +1 -1
- data/lib/bundler/man/bundle-exec.txt +1 -1
- data/lib/bundler/man/bundle-install +1 -1
- data/lib/bundler/man/bundle-install.txt +1 -1
- data/lib/bundler/man/bundle-package +1 -1
- data/lib/bundler/man/bundle-package.txt +1 -1
- data/lib/bundler/man/bundle-update +1 -1
- data/lib/bundler/man/bundle-update.txt +1 -1
- data/lib/bundler/man/bundle.txt +1 -1
- data/lib/bundler/man/gemfile.5 +2 -2
- data/lib/bundler/man/gemfile.5.txt +2 -2
- data/lib/bundler/settings.rb +2 -2
- data/lib/bundler/source.rb +2 -3
- data/lib/bundler/templates/Executable +1 -1
- data/lib/bundler/templates/newgem/Gemfile.tt +1 -1
- data/lib/bundler/templates/newgem/bin/newgem.tt +3 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +11 -12
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +9 -0
- data/man/bundle-config.ronn +90 -0
- data/man/bundle-exec.ronn +98 -0
- data/man/bundle-install.ronn +310 -0
- data/man/bundle-package.ronn +59 -0
- data/man/bundle-update.ronn +176 -0
- data/man/bundle.ronn +77 -0
- data/man/gemfile.5.ronn +254 -0
- data/man/index.txt +6 -0
- data/spec/cache/gems_spec.rb +205 -0
- data/spec/cache/git_spec.rb +9 -0
- data/spec/cache/path_spec.rb +27 -0
- data/spec/cache/platform_spec.rb +57 -0
- data/spec/install/deploy_spec.rb +171 -0
- data/spec/install/deprecated_spec.rb +43 -0
- data/spec/install/gems/c_ext_spec.rb +48 -0
- data/spec/install/gems/env_spec.rb +107 -0
- data/spec/install/gems/flex_spec.rb +272 -0
- data/spec/install/gems/groups_spec.rb +209 -0
- data/spec/install/gems/locked_spec.rb +48 -0
- data/spec/install/gems/packed_spec.rb +72 -0
- data/spec/install/gems/platform_spec.rb +181 -0
- data/spec/install/gems/resolving_spec.rb +72 -0
- data/spec/install/gems/simple_case_spec.rb +709 -0
- data/spec/install/gems/sudo_spec.rb +77 -0
- data/spec/install/gems/win32_spec.rb +26 -0
- data/spec/install/gemspec_spec.rb +96 -0
- data/spec/install/git_spec.rb +552 -0
- data/spec/install/invalid_spec.rb +17 -0
- data/spec/install/path_spec.rb +335 -0
- data/spec/install/upgrade_spec.rb +26 -0
- data/spec/lock/flex_spec.rb +625 -0
- data/spec/lock/git_spec.rb +35 -0
- data/spec/other/check_spec.rb +221 -0
- data/spec/other/config_spec.rb +40 -0
- data/spec/other/console_spec.rb +102 -0
- data/spec/other/exec_spec.rb +241 -0
- data/spec/other/ext_spec.rb +16 -0
- data/spec/other/gem_helper_spec.rb +116 -0
- data/spec/other/help_spec.rb +36 -0
- data/spec/other/init_spec.rb +40 -0
- data/spec/other/newgem_spec.rb +24 -0
- data/spec/other/open_spec.rb +51 -0
- data/spec/other/show_spec.rb +99 -0
- data/spec/pack/gems_spec.rb +22 -0
- data/spec/quality_spec.rb +55 -0
- data/spec/resolver/basic_spec.rb +20 -0
- data/spec/resolver/platform_spec.rb +57 -0
- data/spec/runtime/environment_rb_spec.rb +170 -0
- data/spec/runtime/executable_spec.rb +110 -0
- data/spec/runtime/load_spec.rb +107 -0
- data/spec/runtime/platform_spec.rb +90 -0
- data/spec/runtime/require_spec.rb +261 -0
- data/spec/runtime/setup_spec.rb +412 -0
- data/spec/runtime/with_clean_env_spec.rb +15 -0
- data/spec/spec_helper.rb +81 -0
- data/spec/support/builders.rb +566 -0
- data/spec/support/helpers.rb +243 -0
- data/spec/support/indexes.rb +113 -0
- data/spec/support/matchers.rb +89 -0
- data/spec/support/path.rb +71 -0
- data/spec/support/platforms.rb +49 -0
- data/spec/support/ruby_ext.rb +19 -0
- data/spec/support/rubygems_ext.rb +30 -0
- data/spec/support/rubygems_hax/rubygems_plugin.rb +9 -0
- data/spec/support/sudo.rb +21 -0
- data/spec/update/gems_spec.rb +86 -0
- data/spec/update/git_spec.rb +159 -0
- data/spec/update/source_spec.rb +50 -0
- metadata +170 -32
- data/ROADMAP.md +0 -36
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-INSTALL" "1" "
|
4
|
+
.TH "BUNDLE\-INSTALL" "1" "October 2010" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-PACKAGE" "1" "
|
4
|
+
.TH "BUNDLE\-PACKAGE" "1" "October 2010" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-package\fR \- Package your needed \fB\.gem\fR files into your application
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-UPDATE" "1" "
|
4
|
+
.TH "BUNDLE\-UPDATE" "1" "October 2010" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
data/lib/bundler/man/bundle.txt
CHANGED
data/lib/bundler/man/gemfile.5
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "GEMFILE" "5" "
|
4
|
+
.TH "GEMFILE" "5" "October 2010" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
@@ -148,7 +148,7 @@ After running \fBbundle install \-\-without test\fR, bundler will remember that
|
|
148
148
|
Also, calling \fBBundler\.setup\fR with no parameters, or calling \fBrequire "bundler/setup"\fR will setup all groups except for the ones you excluded via \fB\-\-without\fR (since they are obviously not available)\.
|
149
149
|
.
|
150
150
|
.P
|
151
|
-
Note that on \fBbundle install\fR, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies\. This means that you cannot list different versions of the same gems in different groups\. For more details, see Understanding Bundler \fIhttp://gembundler\.com/
|
151
|
+
Note that on \fBbundle install\fR, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies\. This means that you cannot list different versions of the same gems in different groups\. For more details, see Understanding Bundler \fIhttp://gembundler\.com/rationale\.html\fR\.
|
152
152
|
.
|
153
153
|
.SS "PLATFORMS (:platforms)"
|
154
154
|
If a gem should only be used in a particular platform or set of platforms, you can specify them\. Platforms are essentially identical to groups, except that you do not need to use the \fB\-\-without\fR install\-time flag to exclude groups of gems for other platforms\.
|
@@ -130,7 +130,7 @@ GEMS (#gem)
|
|
130
130
|
in order to create a single canonical list of all of the required gems
|
131
131
|
and their dependencies. This means that you cannot list different ver-
|
132
132
|
sions of the same gems in different groups. For more details, see
|
133
|
-
Understanding Bundler http://gembundler.com/
|
133
|
+
Understanding Bundler http://gembundler.com/rationale.html.
|
134
134
|
|
135
135
|
PLATFORMS (:platforms)
|
136
136
|
If a gem should only be used in a particular platform or set of plat-
|
@@ -314,4 +314,4 @@ SOURCE PRIORITY
|
|
314
314
|
|
315
315
|
|
316
316
|
|
317
|
-
|
317
|
+
October 2010 GEMFILE(5)
|
data/lib/bundler/settings.rb
CHANGED
@@ -50,7 +50,7 @@ module Bundler
|
|
50
50
|
end
|
51
51
|
|
52
52
|
if value = ENV[key]
|
53
|
-
locations << "Set via
|
53
|
+
locations << "Set via #{key}: #{value.inspect}"
|
54
54
|
end
|
55
55
|
|
56
56
|
if @global_config.key?(key)
|
@@ -62,7 +62,7 @@ module Bundler
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def without=(array)
|
65
|
-
unless array.empty?
|
65
|
+
unless array.empty?
|
66
66
|
self[:without] = array.join(":")
|
67
67
|
end
|
68
68
|
end
|
data/lib/bundler/source.rb
CHANGED
@@ -180,8 +180,7 @@ module Bundler
|
|
180
180
|
s.version = VERSION
|
181
181
|
s.platform = Gem::Platform::RUBY
|
182
182
|
s.source = self
|
183
|
-
|
184
|
-
s.loaded_from = 'w0t'
|
183
|
+
s.loaded_from = File.expand_path("..", __FILE__)
|
185
184
|
end
|
186
185
|
idx << bundler
|
187
186
|
end
|
@@ -551,7 +550,7 @@ module Bundler
|
|
551
550
|
out = %x{git #{command}}
|
552
551
|
|
553
552
|
if $? != 0
|
554
|
-
raise GitError, "An error has occurred in git when running `git #{command}
|
553
|
+
raise GitError, "An error has occurred in git when running `git #{command}`. Cannot complete bundling."
|
555
554
|
end
|
556
555
|
out
|
557
556
|
else
|
@@ -1,22 +1,21 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "<%=config[:name]%>/version"
|
3
4
|
|
4
5
|
Gem::Specification.new do |s|
|
5
6
|
s.name = <%=config[:name].inspect%>
|
6
7
|
s.version = <%=config[:constant_name]%>::VERSION
|
7
8
|
s.platform = Gem::Platform::RUBY
|
8
|
-
s.authors = []
|
9
|
-
s.email = []
|
9
|
+
s.authors = ["TODO: Write your name"]
|
10
|
+
s.email = ["TODO: Write your email address"]
|
10
11
|
s.homepage = "http://rubygems.org/gems/<%=config[:name]%>"
|
11
|
-
s.summary =
|
12
|
-
s.description =
|
12
|
+
s.summary = %q{TODO: Write a gem summary}
|
13
|
+
s.description = %q{TODO: Write a gem description}
|
13
14
|
|
14
|
-
s.
|
15
|
-
s.rubyforge_project = <%=config[:name].inspect%>
|
15
|
+
s.rubyforge_project = <%=config[:name].inspect%>
|
16
16
|
|
17
|
-
s.
|
18
|
-
|
19
|
-
s.
|
20
|
-
s.
|
21
|
-
s.require_path = 'lib'
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
22
21
|
end
|
data/lib/bundler/version.rb
CHANGED
@@ -2,5 +2,5 @@ module Bundler
|
|
2
2
|
# We're doing this because we might write tests that deal
|
3
3
|
# with other versions of bundler and we are unsure how to
|
4
4
|
# handle this better.
|
5
|
-
VERSION = "1.0.
|
5
|
+
VERSION = "1.0.2" unless defined?(::Bundler::VERSION)
|
6
6
|
end
|
data/lib/bundler/vlad.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Vlad task for Bundler.
|
2
|
+
#
|
3
|
+
# Just add "require 'bundler/vlad'" in your Vlad deploy.rb, and
|
4
|
+
# Bundler will be activated after each new deployment.
|
5
|
+
require 'bundler/deployment'
|
6
|
+
|
7
|
+
namespace :vlad do
|
8
|
+
Bundler::Deployment.define_task(Rake::RemoteTask, :remote_task, :roles => :app)
|
9
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
bundle-config(1) -- Set bundler configuration options
|
2
|
+
=====================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`bundle config` [<name> [<value>]]
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
This command allows you to interact with bundler's configuration system.
|
11
|
+
Bundler retrieves its configuration from the local application (`app/.bundle/config`),
|
12
|
+
environment variables, and the user's home directory (`~/.bundle/config`),
|
13
|
+
in that order of priority.
|
14
|
+
|
15
|
+
Executing `bundle config` with no parameters will print a list of all
|
16
|
+
bundler configuration for the current bundle, and where that configuration
|
17
|
+
was set.
|
18
|
+
|
19
|
+
Executing `bundle config <name>` will print the value of that configuration
|
20
|
+
setting, and where it was set.
|
21
|
+
|
22
|
+
Executing `bundle config <name> <value>` will set that configuration to the
|
23
|
+
value specified for all bundles executed as the current user. The configuration
|
24
|
+
will be stored in `~/.bundle/config`.
|
25
|
+
|
26
|
+
## BUILD OPTIONS
|
27
|
+
|
28
|
+
You can use `bundle config` to give bundler the flags to pass to the gem
|
29
|
+
installer every time bundler tries to install a particular gem.
|
30
|
+
|
31
|
+
A very common example, the `mysql` gem, requires Snow Leopard users to
|
32
|
+
pass configuration flags to `gem install` to specify where to find the
|
33
|
+
`mysql_config` executable.
|
34
|
+
|
35
|
+
gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
|
36
|
+
|
37
|
+
Since the specific location of that executable can change from machine
|
38
|
+
to machine, you can specify these flags on a per-machine basis.
|
39
|
+
|
40
|
+
bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
|
41
|
+
|
42
|
+
After running this command, every time bundler needs to install the
|
43
|
+
`mysql` gem, it will pass along the flags you specified.
|
44
|
+
|
45
|
+
## CONFIGURATION KEYS
|
46
|
+
|
47
|
+
Configuration keys in bundler have two forms: the canonical form and the
|
48
|
+
environment variable form.
|
49
|
+
|
50
|
+
For instance, passing the `--without` flag to [bundle install(1)][bundle-install]
|
51
|
+
prevents Bundler from installing certain groups specified in the Gemfile(5). Bundler
|
52
|
+
persists this value in `app/.bundle/config` so that calls to `Bundler.setup`
|
53
|
+
do not try to find gems from the `Gemfile` that you didn't install. Additionally,
|
54
|
+
subsequent calls to [bundle install(1)][bundle-install] remember this setting and skip those
|
55
|
+
groups.
|
56
|
+
|
57
|
+
The canonical form of this configuration is `"without"`. To convert the canonical
|
58
|
+
form to the environment variable form, capitalize it, and prepend `BUNDLE_`. The
|
59
|
+
environment variable form of `"without"` is `BUNDLE_WITHOUT`.
|
60
|
+
|
61
|
+
## LIST OF AVAILABLE KEYS
|
62
|
+
|
63
|
+
The following is a list of all configuration keys and their purpose. You can
|
64
|
+
learn more about their operation in [bundle install(1)][bundle-install].
|
65
|
+
|
66
|
+
* `path` (`BUNDLE_PATH`):
|
67
|
+
The location on disk to install gems. Defaults to `$GEM_HOME` in development
|
68
|
+
and `vendor/bundler` when `--deployment` is used
|
69
|
+
* `frozen` (`BUNDLE_FROZEN`):
|
70
|
+
Disallow changes to the `Gemfile`. Defaults to `true` when `--deployment`
|
71
|
+
is used.
|
72
|
+
* `without` (`BUNDLE_WITHOUT`):
|
73
|
+
A `:`-separated list of groups whose gems bundler should not install
|
74
|
+
* `bin` (`BUNDLE_BIN`):
|
75
|
+
Install executables from gems in the bundle to the specified directory.
|
76
|
+
Defaults to `false`.
|
77
|
+
* `gemfile` (`BUNDLE_GEMFILE`):
|
78
|
+
The name of the file that bundler should use as the `Gemfile`. This location
|
79
|
+
of this file also sets the root of the project, which is used to resolve
|
80
|
+
relative paths in the `Gemfile`, among other things. By default, bundler
|
81
|
+
will search up from the current working directory until it finds a
|
82
|
+
`Gemfile`.
|
83
|
+
|
84
|
+
In general, you should set these settings per-application by using the applicable
|
85
|
+
flag to the [bundle install(1)][bundle-install] command.
|
86
|
+
|
87
|
+
You can set them globally either via environment variables or `bundle config`,
|
88
|
+
whichever is preferable for your setup. If you use both, environment variables
|
89
|
+
will take preference over global settings.
|
90
|
+
|
@@ -0,0 +1,98 @@
|
|
1
|
+
bundle-exec(1) -- Execute a command in the context of the bundle
|
2
|
+
================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`bundle exec` <command>
|
7
|
+
|
8
|
+
## DESCRIPTION
|
9
|
+
|
10
|
+
This command executes the command, making all gems specified in the
|
11
|
+
`Gemfile(5)` available to `require` in Ruby programs.
|
12
|
+
|
13
|
+
Essentially, if you would normally have run something like
|
14
|
+
`rspec spec/my_spec.rb`, and you want to use the gems specified
|
15
|
+
in the `Gemfile(5)` and installed via [bundle install(1)][bundle-install], you
|
16
|
+
should run `bundle exec rspec spec/my_spec.rb`.
|
17
|
+
|
18
|
+
Note that `bundle exec` does not require that an executable is
|
19
|
+
available on your shell's `$PATH`.
|
20
|
+
|
21
|
+
## BUNDLE INSTALL --BINSTUBS
|
22
|
+
|
23
|
+
If you use the `--binstubs` flag in [bundle install(1)][bundle-install], Bundler will
|
24
|
+
automatically create a directory (which defaults to `app_root/bin`)
|
25
|
+
containing all of the executables available from gems in the bundle.
|
26
|
+
|
27
|
+
After using `--binstubs`, `bin/rspec spec/my_spec.rb` is identical
|
28
|
+
to `bundle exec rspec spec/my_spec.rb`.
|
29
|
+
|
30
|
+
## ENVIRONMENT MODIFICATIONS
|
31
|
+
|
32
|
+
`bundle exec` makes a number of changes to the shell environment,
|
33
|
+
then executes the command you specify in full.
|
34
|
+
|
35
|
+
* make sure that it's still possible to shell out to `bundle`
|
36
|
+
from inside a command invoked by `bundle exec` (using
|
37
|
+
`$BUNDLE_BIN_PATH`)
|
38
|
+
* put the directory containing executables (like `rails`, `rspec`,
|
39
|
+
`rackup`) for your bundle on `$PATH`
|
40
|
+
* make sure that if bundler is invoked in the subshell, it uses
|
41
|
+
the same `Gemfile` (by setting `BUNDLE_GEMFILE`)
|
42
|
+
* add `-rbundler/setup` to `$RUBYOPT`, which makes sure that
|
43
|
+
Ruby programs invoked in the subshell can see the gems in
|
44
|
+
the bundle
|
45
|
+
|
46
|
+
It also modifies Rubygems:
|
47
|
+
|
48
|
+
* disallow loading additional gems not in the bundle
|
49
|
+
* modify the `gem` method to be a no-op if a gem matching
|
50
|
+
the requirements is in the bundle, and to raise a
|
51
|
+
`Gem::LoadError` if it's not
|
52
|
+
* Define `Gem.refresh` to be a no-op, since the source
|
53
|
+
index is always frozen when using bundler, and to
|
54
|
+
prevent gems from the system leaking into the environment
|
55
|
+
* Override `Gem.bin_path` to use the gems in the bundle,
|
56
|
+
making system executables work
|
57
|
+
* Add all gems in the bundle into Gem.loaded_specs
|
58
|
+
|
59
|
+
## RUBYGEMS PLUGINS
|
60
|
+
|
61
|
+
At present, the Rubygems plugin system requires all files
|
62
|
+
named `rubygems_plugin.rb` on the load path of _any_ installed
|
63
|
+
gem when any Ruby code requires `rubygems.rb`. This includes
|
64
|
+
executables installed into the system, like `rails`, `rackup`,
|
65
|
+
and `rspec`.
|
66
|
+
|
67
|
+
Since Rubygems plugins can contain arbitrary Ruby code, they
|
68
|
+
commonly end up activating themselves or their dependencies.
|
69
|
+
|
70
|
+
For instance, the `gemcutter 0.5` gem depended on `json_pure`.
|
71
|
+
If you had that version of gemcutter installed (even if
|
72
|
+
you _also_ had a newer version without this problem), Rubygems
|
73
|
+
would activate `gemcutter 0.5` and `json_pure <latest>`.
|
74
|
+
|
75
|
+
If your Gemfile(5) also contained `json_pure` (or a gem
|
76
|
+
with a dependency on `json_pure`), the latest version on
|
77
|
+
your system might conflict with the version in your
|
78
|
+
Gemfile(5), or the snapshot version in your `Gemfile.lock`.
|
79
|
+
|
80
|
+
If this happens, bundler will say:
|
81
|
+
|
82
|
+
You have already activated json_pure 1.4.6 but your Gemfile
|
83
|
+
requires json_pure 1.4.3. Consider using bundle exec.
|
84
|
+
|
85
|
+
In this situation, you almost certainly want to remove the
|
86
|
+
underlying gem with the problematic gem plugin. In general,
|
87
|
+
the authors of these plugins (in this case, the `gemcutter`
|
88
|
+
gem) have released newer versions that are more careful in
|
89
|
+
their plugins.
|
90
|
+
|
91
|
+
You can find a list of all the gems containing gem plugins
|
92
|
+
by running
|
93
|
+
|
94
|
+
ruby -rubygems -e "puts Gem.find_files('rubygems_plugin.rb')"
|
95
|
+
|
96
|
+
At the very least, you should remove all but the newest
|
97
|
+
version of each gem plugin, and also remove all gem plugins
|
98
|
+
that you aren't using (`gem uninstall gem_name`).
|
@@ -0,0 +1,310 @@
|
|
1
|
+
bundle-install(1) -- Install the dependencies specified in your Gemfile
|
2
|
+
=======================================================================
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`bundle install` [--local] [--quiet] [--gemfile=GEMFILE] [--system]
|
7
|
+
[--deployment] [--frozen] [--path]
|
8
|
+
[--binstubs[=DIRECTORY]] [--without=GROUP1[ GROUP2...]]
|
9
|
+
|
10
|
+
## DESCRIPTION
|
11
|
+
|
12
|
+
Install the gems specified in your Gemfile(5). If this is the first
|
13
|
+
time you run bundle install (and a `Gemfile.lock` does not exist),
|
14
|
+
bundler will fetch all remote sources, resolve dependencies and
|
15
|
+
install all needed gems.
|
16
|
+
|
17
|
+
If a `Gemfile.lock` does exist, and you have not updated your Gemfile(5),
|
18
|
+
bundler will fetch all remote sources, but use the dependencies
|
19
|
+
specified in the `Gemfile.lock` instead of resolving dependencies.
|
20
|
+
|
21
|
+
If a `Gemfile.lock` does exist, and you have updated your Gemfile(5),
|
22
|
+
bundler will use the dependencies in the `Gemfile.lock` for all gems
|
23
|
+
that you did not update, but will re-resolve the dependencies of
|
24
|
+
gems that you did update. You can find more information about this
|
25
|
+
update process below under [CONSERVATIVE UPDATING][].
|
26
|
+
|
27
|
+
## OPTIONS
|
28
|
+
|
29
|
+
* `--gemfile=<gemfile>`:
|
30
|
+
The location of the Gemfile(5) that bundler should use. This defaults
|
31
|
+
to a gemfile in the current working directory. In general, bundler
|
32
|
+
will assume that the location of the Gemfile(5) is also the project
|
33
|
+
root, and will look for the `Gemfile.lock` and `vendor/cache` relative
|
34
|
+
to it.
|
35
|
+
|
36
|
+
* `--path=<path>`:
|
37
|
+
The location to install the gems in the bundle to. This defaults
|
38
|
+
to the gem home, which is the location that `gem install` installs
|
39
|
+
gems to. This means that, by default, gems installed without a
|
40
|
+
`--path` setting will show up in `gem list`. This setting is a
|
41
|
+
[remembered option][REMEMBERED OPTIONS].
|
42
|
+
|
43
|
+
* `--system`:
|
44
|
+
Installs the gems in the bundle to the system location. This
|
45
|
+
overrides any previous [remembered][REMEMBERED OPTIONS] use of
|
46
|
+
`--path`.
|
47
|
+
|
48
|
+
* `--without=<list>`:
|
49
|
+
A space-separated list of groups to skip installing. This is a
|
50
|
+
[remembered option][REMEMBERED OPTIONS].
|
51
|
+
|
52
|
+
* `--local`:
|
53
|
+
Do not attempt to connect to `rubygems.org`, instead using just
|
54
|
+
the gems located in `vendor/cache`. Note that if a more
|
55
|
+
appropriate platform-specific gem exists on `rubygems.org`,
|
56
|
+
this will bypass the normal lookup.
|
57
|
+
|
58
|
+
* `--deployment`:
|
59
|
+
Switches bundler's defaults into [deployment mode][DEPLOYMENT MODE].
|
60
|
+
|
61
|
+
* `--binstubs[=<directory>]`:
|
62
|
+
Create a directory (defaults to `bin`) containing an executable
|
63
|
+
that runs in the context of the bundle. For instance, if the
|
64
|
+
`rails` gem comes with a `rails` executable, this flag will create
|
65
|
+
a `bin/rails` executable that ensures that all dependencies used
|
66
|
+
come from the bundled gems.
|
67
|
+
|
68
|
+
## DEPLOYMENT MODE
|
69
|
+
|
70
|
+
Bundler's defaults are optimized for development. To switch to
|
71
|
+
defaults optimized for deployment, use the `--deployment` flag.
|
72
|
+
|
73
|
+
1. A `Gemfile.lock` is required.
|
74
|
+
|
75
|
+
To ensure that the same versions of the gems you developed with
|
76
|
+
and tested with are also used in deployments, a `Gemfile.lock`
|
77
|
+
is required.
|
78
|
+
|
79
|
+
This is mainly to ensure that you remember to check your
|
80
|
+
`Gemfile.lock` into version control.
|
81
|
+
|
82
|
+
2. The `Gemfile.lock` must be up to date
|
83
|
+
|
84
|
+
In development, you can modify your Gemfile(5) and re-run
|
85
|
+
`bundle install` to [conservatively update][CONSERVATIVE UPDATING]
|
86
|
+
your `Gemfile.lock` snapshot.
|
87
|
+
|
88
|
+
In deployment, your `Gemfile.lock` should be up-to-date with
|
89
|
+
changes made in your Gemfile(5).
|
90
|
+
|
91
|
+
3. Gems are installed to `vendor/bundle` not your default system location
|
92
|
+
|
93
|
+
In development, it's convenient to share the gems used in your
|
94
|
+
application with other applications and other scripts run on
|
95
|
+
the system.
|
96
|
+
|
97
|
+
In deployment, isolation is a more important default. In addition,
|
98
|
+
the user deploying the application may not have permission to install
|
99
|
+
gems to the system, or the web server may not have permission to
|
100
|
+
read them.
|
101
|
+
|
102
|
+
As a result, `bundle install --deployment` installs gems to
|
103
|
+
the `vendor/bundle` directory in the application. This may be
|
104
|
+
overridden using the `--path` option.
|
105
|
+
|
106
|
+
## SUDO USAGE
|
107
|
+
|
108
|
+
By default, bundler installs gems to the same location as `gem install`.
|
109
|
+
|
110
|
+
In some cases, that location may not be writable by your Unix user. In
|
111
|
+
that case, bundler will stage everything in a temporary directory,
|
112
|
+
then ask you for your `sudo` password in order to copy the gems into
|
113
|
+
their system location.
|
114
|
+
|
115
|
+
From your perspective, this is identical to installing them gems
|
116
|
+
directly into the system.
|
117
|
+
|
118
|
+
You should never use `sudo bundle install`. This is because several
|
119
|
+
other steps in `bundle install` must be performed as the current user:
|
120
|
+
|
121
|
+
* Updating your `Gemfile.lock`
|
122
|
+
* Updating your `vendor/cache`, if necessary
|
123
|
+
* Checking out private git repositories using your user's SSH keys
|
124
|
+
|
125
|
+
Of these three, the first two could theoretically be performed by
|
126
|
+
`chown`ing the resulting files to `$SUDO_USER`. The third, however,
|
127
|
+
can only be performed by actually invoking the `git` command as
|
128
|
+
the current user.
|
129
|
+
|
130
|
+
As a result, you should run `bundle install` as the current user,
|
131
|
+
and bundler will ask for your password if it is needed to perform
|
132
|
+
the final step.
|
133
|
+
|
134
|
+
## INSTALLING GROUPS
|
135
|
+
|
136
|
+
By default, `bundle install` will install all gems in all groups
|
137
|
+
in your Gemfile(5), except those declared for a different platform.
|
138
|
+
|
139
|
+
However, you can explicitly tell bundler to skip installing
|
140
|
+
certain groups with the `--without` option. This option takes
|
141
|
+
a space-separated list of groups.
|
142
|
+
|
143
|
+
While the `--without` option will skip _installing_ the gems in the
|
144
|
+
specified groups, it will still _download_ those gems and use them to
|
145
|
+
resolve the dependencies of every gem in your Gemfile(5).
|
146
|
+
|
147
|
+
This is so that installing a different set of groups on another
|
148
|
+
machine (such as a production server) will not change the
|
149
|
+
gems and versions that you have already developed and tested against.
|
150
|
+
|
151
|
+
`Bundler offers a rock-solid guarantee that the third-party
|
152
|
+
code you are running in development and testing is also the
|
153
|
+
third-party code you are running in production. You can choose
|
154
|
+
to exclude some of that code in different environments, but you
|
155
|
+
will never be caught flat-footed by different versions of
|
156
|
+
third-party code being used in different environments.`
|
157
|
+
|
158
|
+
For a simple illustration, consider the following Gemfile(5):
|
159
|
+
|
160
|
+
source "http://rubygems.org"
|
161
|
+
|
162
|
+
gem "sinatra"
|
163
|
+
|
164
|
+
group :production do
|
165
|
+
gem "rack-perftools-profiler"
|
166
|
+
end
|
167
|
+
|
168
|
+
In this case, `sinatra` depends on any version of Rack (`>= 1.0`, while
|
169
|
+
`rack-perftools-profiler` depends on 1.x (`~> 1.0`).
|
170
|
+
|
171
|
+
When you run `bundle install --without production` in development, we
|
172
|
+
look at the dependencies of `rack-perftools-profiler` as well. That way,
|
173
|
+
you do not spend all your time developing against Rack 2.0, using new
|
174
|
+
APIs unavailable in Rack 1.x, only to have bundler switch to Rack 1.2
|
175
|
+
when the `production` group _is_ used.
|
176
|
+
|
177
|
+
This should not cause any problems in practice, because we do not
|
178
|
+
attempt to `install` the gems in the excluded groups, and only evaluate
|
179
|
+
as part of the dependency resolution process.
|
180
|
+
|
181
|
+
This also means that you cannot include different versions of the same
|
182
|
+
gem in different groups, because doing so would result in different
|
183
|
+
sets of dependencies used in development and production. Because of
|
184
|
+
the vagaries of the dependency resolution process, this usually
|
185
|
+
affects more than just the gems you list in your Gemfile(5), and can
|
186
|
+
(surprisingly) radically change the gems you are using.
|
187
|
+
|
188
|
+
## REMEMBERED OPTIONS
|
189
|
+
|
190
|
+
Some options (marked above in the [OPTIONS][] section) are remembered
|
191
|
+
between calls to `bundle install`, and by the Bundler runtime.
|
192
|
+
|
193
|
+
For instance, if you run `bundle install --without test`, a subsequent
|
194
|
+
call to `bundle install` that does not include a `--without` flag will
|
195
|
+
remember your previous choice.
|
196
|
+
|
197
|
+
In addition, a call to `Bundler.setup` will not attempt to make the
|
198
|
+
gems in those groups available on the Ruby load path, as they were
|
199
|
+
not installed.
|
200
|
+
|
201
|
+
The settings that are remembered are:
|
202
|
+
|
203
|
+
* `--deployment`:
|
204
|
+
At runtime, this remembered setting will also result in Bundler
|
205
|
+
raising an exception if the `Gemfile.lock` is out of date.
|
206
|
+
|
207
|
+
* `--path`:
|
208
|
+
Subsequent calls to `bundle install` will install gems to the
|
209
|
+
directory originally passed to `--path`. The Bundler runtime
|
210
|
+
will look for gems in that location. You can revert this
|
211
|
+
option by running `bundle install --system`.
|
212
|
+
|
213
|
+
* `--binstubs`:
|
214
|
+
Bundler will update the executables every subsequent call to
|
215
|
+
`bundle install`.
|
216
|
+
|
217
|
+
* `--without`:
|
218
|
+
As described above, Bundler will skip the gems specified by
|
219
|
+
`--without` in subsequent calls to `bundle install`. The
|
220
|
+
Bundler runtime will also not try to make the gems in the
|
221
|
+
skipped groups available.
|
222
|
+
|
223
|
+
## THE GEMFILE.LOCK
|
224
|
+
|
225
|
+
When you run `bundle install`, Bundler will persist the full names
|
226
|
+
and versions of all gems that you used (including dependencies of
|
227
|
+
the gems specified in the Gemfile(5)) into a file called `Gemfile.lock`.
|
228
|
+
|
229
|
+
Bundler uses this file in all subsequent calls to `bundle install`,
|
230
|
+
which guarantees that you always use the same exact code, even
|
231
|
+
as your application moves across machines.
|
232
|
+
|
233
|
+
Because of the way dependency resolution works, even a
|
234
|
+
seemingly small change (for instance, an update to a point-release
|
235
|
+
of a dependency of a gem in your Gemfile(5)) can result in radically
|
236
|
+
different gems being needed to satisfy all dependencies.
|
237
|
+
|
238
|
+
As a result, you `SHOULD` check your `Gemfile.lock` into version
|
239
|
+
control. If you do not, every machine that checks out your
|
240
|
+
repository (including your production server) will resolve all
|
241
|
+
dependencies again, which will result in different versions of
|
242
|
+
third-party code being used if `any` of the gems in the Gemfile(5)
|
243
|
+
or any of their dependencies have been updated.
|
244
|
+
|
245
|
+
## CONSERVATIVE UPDATING
|
246
|
+
|
247
|
+
When you make a change to the Gemfile(5) and then run `bundle install`,
|
248
|
+
Bundler will update only the gems that you modified.
|
249
|
+
|
250
|
+
In other words, if a gem that you `did not modify` worked before
|
251
|
+
you called `bundle install`, it will continue to use the exact
|
252
|
+
same versions of all dependencies as it used before the update.
|
253
|
+
|
254
|
+
Let's take a look at an example. Here's your original Gemfile(5):
|
255
|
+
|
256
|
+
source "http://rubygems.org"
|
257
|
+
|
258
|
+
gem "actionpack", "2.3.8"
|
259
|
+
gem "activemerchant"
|
260
|
+
|
261
|
+
In this case, both `actionpack` and `activemerchant` depend on
|
262
|
+
`activesupport`. The `actionpack` gem depends on `activesupport 2.3.8`
|
263
|
+
and `rack ~> 1.1.0`, while the `activemerchant` gem depends on
|
264
|
+
`activesupport >= 2.3.2`, `braintree >= 2.0.0`, and `builder >= 2.0.0`.
|
265
|
+
|
266
|
+
When the dependencies are first resolved, Bundler will select
|
267
|
+
`activesupport 2.3.8`, which satisfies the requirements of both
|
268
|
+
gems in your Gemfile(5).
|
269
|
+
|
270
|
+
Next, you modify your Gemfile(5) to:
|
271
|
+
|
272
|
+
source "http://rubygems.org"
|
273
|
+
|
274
|
+
gem "actionpack", "3.0.0.rc"
|
275
|
+
gem "activemerchant"
|
276
|
+
|
277
|
+
The `actionpack 3.0.0.rc` gem has a number of new dependencies,
|
278
|
+
and updates the `activesupport` dependency to `= 3.0.0.rc` and
|
279
|
+
the `rack` dependency to `~> 1.2.1`.
|
280
|
+
|
281
|
+
When you run `bundle install`, Bundler notices that you changed
|
282
|
+
the `actionpack` gem, but not the `activemerchant` gem. It
|
283
|
+
evaluates the gems currently being used to satisfy its requirements:
|
284
|
+
|
285
|
+
* `activesupport 2.3.8`:
|
286
|
+
also used to satisfy a dependency in `activemerchant`,
|
287
|
+
which is not being updated
|
288
|
+
* `rack ~> 1.1.0`:
|
289
|
+
not currently being used to satify another dependency
|
290
|
+
|
291
|
+
Because you did not explicitly ask to update `activemerchant`,
|
292
|
+
you would not expect it to suddenly stop working after updating
|
293
|
+
`actionpack`. However, satisfying the new `activesupport 3.0.0.rc`
|
294
|
+
dependency of actionpack requires updating one of its dependencies.
|
295
|
+
|
296
|
+
Even though `activemerchant` declares a very loose dependency
|
297
|
+
that theoretically matches `activesupport 3.0.0.rc`, bundler treats
|
298
|
+
gems in your Gemfile(5) that have not changed as an atomic unit
|
299
|
+
together with their dependencies. In this case, the `activemerchant`
|
300
|
+
dependency is treated as `activemerchant 1.7.1 + activesupport 2.3.8`,
|
301
|
+
so `bundle install` will report that it cannot update `actionpack`.
|
302
|
+
|
303
|
+
To explicitly update `actionpack`, including its dependencies
|
304
|
+
which other gems in the Gemfile(5) still depend on, run
|
305
|
+
`bundle update actionpack` (see `bundle update(1)`).
|
306
|
+
|
307
|
+
`Summary`: In general, after making a change to the Gemfile(5) , you
|
308
|
+
should first try to run `bundle install`, which will guarantee that no
|
309
|
+
other gems in the Gemfile(5) are impacted by the change. If that
|
310
|
+
does not work, run [bundle update(1)][bundle-update].
|