bundler

groups

http://bundler.io/groups.html

gems outside any named group are in default group.

install gems from all groups:

$ bundle

install gems from all groups except production:

$ bundle --without production

if your app is gem dependent gems are added to gemspec file instead of Gemfile using add_runtime_dependency (kind of default group) or add_development_dependency (kind of development group) methods. these dependencies are then included in Gemfile using gemspec directive. in this case Gemfile might contain only test or custom groups.

require

http://bundler.io/groups.html

require all gems from groups default and production:

Bundler.require(:default, :production)

Rails app by default requires default and group corresponding to current environment in config/application.rb:

# Rails.groups = [:default, Rails.env]
Bundler.require(*Rails.groups)

in plain Ruby app you have 2 options:

setup

http://bundler.io/bundler_setup.html

bundler setup configures the load path so that gems from all or specified groups can be required.