1. Gemfile manual
    1. SOURCES
      1. source "http://rubygems.org" source "http://gems.github.com"
    2. RUBY
      1. VERSION
      2. ENGINE
      3. ENGINE VERSION
      4. eg: ruby "1.8.7", :engine => "jruby", :engine_version => "1.6.7"
    3. GEMS
      1. NAME
        1. gem "nokogiri"
      2. VERSION
        1. gem "RedCloth", ">= 4.1.0", "< 4.2.0"
      3. REQUIRE AS (:require)
        1. gem "redis", :require => ["redis/connection/hiredis", "redis"] gem "webmock", :require => false
      4. GROUPS (:group or :groups)
        1. gem "rspec", :group => :test
      5. PLATFORMS (:platforms)
        1. gem "nokogiri", :platforms => [:mri_18, :jruby]
      6. GIT (:git)
        1. gem "rails", :git => "git://github.com/rails/rails.git"
      7. GITHUB (:github)
        1. gem "rails", :github => "rails/rails"
      8. PATH (:path)
        1. gem "rails", :path => "vendor/rails"
    4. BLOCK FORM OF GIT, PATH, GROUP and PLATFORMS
      1. git "git://github.com/rails/rails.git" do gem "activesupport" gem "actionpack" end platforms :ruby do gem "ruby-debug" gem "sqlite3" end group :development do gem "wirble" gem "faker" end
    5. GEMSPEC (#gemspec)
      1. If you wish to use Bundler to help install dependencies for a gem while it is being developed, use the gemspec method to pull in the dependencies listed in the .gemspec file.
    6. SOURCE PRIORITY
      1. 1. The source explicitly attached to the gem (using :path or :git) 2. For implicit gems (dependencies of explicit gems), any git or path repository otherwise declared. This results in bundler prioritizing the ActiveSupport gem from the Rails git repository over ones from rubygems.org 3. The sources specified via source, searching each source in your Gemfile from last added to first added.
  2. CLI Manual
    1. OPTIONS
      1. --no-color
        1. Prints all output without color
      2. --verbose
        1. Prints out additional logging information
    2. PRIMARY COMMANDS
      1. bundle install
        1. OPTIONS
          1. --gemfile=<gemfile>
          2. The location of the Gemfile(5) that bundler should use. This defaults to a gemfile in the current working directory. In general, bundler will assume that the location of the Gemfile(5) is also the project root, and will look for the Gemfile.lock and vendor/cache relative to it.
          3. --path=<path>
          4. The location to install the gems in the bundle to. This defaults to the gem home, which is the location that gem install installs gems to. This means that, by default, gems installed without a --path setting will show up in gem list. This setting is a remembered option.
          5. --system
          6. Installs the gems in the bundle to the system location. This overrides any previous remembered use of --path.
          7. --without=<list>
          8. A space-separated list of groups to skip installing. This is a remembered option.
          9. --local
          10. Do not attempt to connect to rubygems.org, instead using just the gems already present in Rubygems' cache or in vendor/cache. Note that if a more appropriate platform-specific gem exists on rubygems.org, it will not be found.
          11. --deployment
          12. Switches bundler's defaults into deployment mode. Do not use this flag on development machines.
          13. --binstubs[=<directory>]
          14. Create a directory (defaults to bin) containing an executable that runs in the context of the bundle. For instance, if the rails gem comes with a rails executable, this flag will create a bin/rails executable that ensures that all dependencies used come from the bundled gems.
          15. --shebang ruby-install-name
          16. Uses the ruby executable (usually ruby) provided to execute the scripts created with --binstubs. For instance, if you use --binstubs with --shebang jruby, all executables will be created to use jruby instead.
          17. --standalone[=<list>]
          18. Make a bundle that can work without Ruby Gems or Bundler at runtime. It takes a space separated list of groups to install. It creates a bundle directory and installs the bundle there. It also generates a bundle/bundler/setup.rb file to replace Bundler's own setup.
          19. --no-cache
          20. Do not update the cache in vendor/cache with the newly bundled gems. This does not remove any existing cached gems, only stops the newly bundled gems from being cached during the install.
        2. DEPLOYMENT MODE
          1. Bundler's defaults are optimized for development. To switch to defaults optimized for deployment, use the --deployment flag. Do not activate deployment mode on development machines, as it will cause in an error when the Gemfile is modified.
          2. A Gemfile.lock is required.
          3. The Gemfile.lock must be up to date
          4. Gems are installed to vendor/bundle not your default system location
        3. SUDO USAGE
          1. You should never use sudo bundle install. This is because several other steps in bundle install must be performed as the current user:
          2. run bundle install
        4. INSTALLING GROUPS
          1. bundle install --without production
        5. REMEMBERED OPTIONS
          1. Some options (marked above in the OPTIONS section) are remembered between calls to bundle install, and by the Bundler runtime.
          2. --deployment
          3. --path
          4. --binstubs
          5. --without
        6. THE GEMFILE.LOCK
          1. When you run bundle install, Bundler will persist the full names and versions of all gems that you used (including dependencies of the gems specified in the Gemfile(5)) into a file called Gemfile.lock.
        7. CONSERVATIVE UPDATING
      2. bundle update
        1. OPTIONS
          1. --source=<name>
          2. The name of a :git or :path source used in the Gemfile(5). For instance, with a :git source of http://github.com/rails/rails.git, you would call bundle update --source rails
        2. UPDATING ALL GEMS
          1. If you run bundle update with no parameters, bundler will ignore any previously installed gems and resolve all dependencies again based on the latest versions of all gems available in the sources.
        3. UPDATING A LIST OF GEMS
          1. bundle update nokogiri.
        4. OVERLAPPING DEPENDENCIES
        5. RECOMMENDED WORKFLOW
          1. After you create your Gemfile(5) for the first time, run $ bundle install Check the resulting Gemfile.lock into version control $ git add Gemfile.lock When checking out this repository on another development machine, run $ bundle install When checking out this repository on a deployment machine, run $ bundle install --deployment After changing the Gemfile(5) to reflect a new or update dependency, run $ bundle install Make sure to check the updated Gemfile.lock into version control $ git add Gemfile.lock If bundle install(1) reports a conflict, manually update the specific gems that you changed in the Gemfile(5) $ bundle update rails thin If you want to update all the gems to the latest possible versions that still match the gems listed in the Gemfile(5), run $ bundle update
      3. bundle package
        1. GIT AND PATH GEMS
          1. Since Bundler 1.2, the bundle package command can also package :git and :path dependencies besides .gem files. This needs to be explicitly enabled via the --all option. Once used, the --all option will be remembered.
        2. REMOTE FETCHING
          1. By default, if you simply run bundle install(1) after running bundle package(1), bundler will still connect to rubygems.org to check whether a platform-specific gem exists for any of the gems in vendor/cache.
      4. bundle exec
        1. BUNDLE INSTALL --BINSTUBS
          1. If you use the --binstubs flag in bundle install(1), Bundler will automatically create a directory (which defaults to app_root/bin) containing all of the executables available from gems in the bundle
        2. ENVIRONMENT MODIFICATIONS
          1. bundle exec makes a number of changes to the shell environment, then executes the command you specify in full.
        3. RUBYGEMS PLUGINS
          1. at present, the Rubygems plugin system requires all files named rubygems_plugin.rb on the load path of any installed gem when any Ruby code requires rubygems.rb. This includes executables installed into the system, like rails, rackup, and rspec.
      5. bundle config
        1. BUILD OPTIONS
          1. gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
        2. CONFIGURATION KEYS
          1. Configuration keys in bundler have two forms: the canonical form and the environment variable form.
        3. LIST OF AVAILABLE KEYS
          1. path (BUNDLE_PATH)
          2. The location on disk to install gems. Defaults to $GEM_HOME in development and vendor/bundler when --deployment is used
          3. frozen (BUNDLE_FROZEN)
          4. Disallow changes to the Gemfile. Defaults to true when --deployment is used.
          5. without (BUNDLE_WITHOUT)
          6. A :-separated list of groups whose gems bundler should not install
          7. bin (BUNDLE_BIN)
          8. Install executables from gems in the bundle to the specified directory. Defaults to false.
          9. gemfile (BUNDLE_GEMFILE)
          10. The name of the file that bundler should use as the Gemfile. This location of this file also sets the root of the project, which is used to resolve relative paths in the Gemfile, among other things. By default, bundler will search up from the current working directory until it finds a Gemfile.
        4. LOCAL GIT REPOS
          1. bundle config local.GEM_NAME /path/to/local/git/repository
    3. UTILITIES
      1. bundle check
        1. Determine whether the requirements for your application are installed and available to bundler
      2. bundle list
        1. Show all of the gems in the current bundle
      3. bundle show
        1. Show the source location of a particular gem in the bundle
      4. bundle outdated
        1. Show all of the outdated gems in the current bundle
      5. bundle console
        1. Start an IRB session in the context of the current bundle
      6. bundle open
        1. Open an installed gem in the editor
      7. bundle viz
        1. Generate a visual representation of your dependencies
      8. bundle init
        1. Generate a simple Gemfile, placed in the current directory
      9. bundle gem
        1. Create a simple gem, suitable for development with bundler