Docs header transparent bg

Using Groups

Grouping your dependencies allows you to perform operations on the entire group.
# These gems are in the :default group
gem 'nokogiri'
gem 'sinatra'

gem 'wirble', :group => :development

group :test do
  gem 'rspec'
  gem 'faker'

Install all dependencies, except those in specified groups
$ bundle install --without test

Require the gems in particular groups, noting that gems outside of a named group are in the :default group
Bundler.require(:default, :development)

Require the default gems, plus the gems in a group named the same as the current Rails environment
Bundler.require(:default, Rails.env)

Restrict the groups of gems that you want to add to the load path. Only gems in these groups will be require'able
require 'rubygems'
require 'bundler'
Bundler.setup(:default, :ci)
require 'nokogiri'
Learn More: Bundler.setup
Edit this document on GitHub if you caught an error or noticed something was missing.