Q:

How to tell bundler to ignore gems that don't exist?

My organization has a number of in-house gems that are used in automated testing, but are not required for a production deployment. I am trying to use Bundler and so in my Gemfile I've wrapped those gems in:
group :test, :development do
    gem 'dashboard_summary'
end

However, when I run:
$ bundle install --without staging development test

I still get
Could not find gem 'dashboard_summary (>= 0) ruby' in the gems available on this machine.

I'm trying to understand why Bundler isn't ignoring that gem when I've told it to.

A:

This is expected behaviour. From the docs:

While the --without option will skip installing the gems in the specified groups, it will still download those gems and use them to resolve the dependencies of every gem in your Gemfile(5).

Whilst an up to date Gemfile.lock might suggest that the dependencies don’t need to be resolved again, it looks like all gems are downloaded even in this case.

A:

You didn't define any group that includes staging, development and test. Your group only had test and development. 
Bundler is trying to ignore a group which has all three name in it, so you can add staging to 
group :test, :development, :staging do
    gem 'dashboard_summary'
end

or you can use
 $ bundle install --without test development

