Rails bundle install production only

An alternative solution is to use the bundle-only ruby gem. It can be used as follows:

> gem install bundle-only
> bundle-only production

This library does not pollute your bundler configs or augment Gemfile.lock; it is a simple alternative to the built in bundle --without every other group option that bundler provides.


THIS ANSWER IS OUTDATED


Take a look at --without option:

bundle install --without development test

By default Bundler installs all gems and your application uses the gems that it needs. Bundler itself knows nothing about Rails and the current environment.