Meltemi
Meltemi

Reputation: 38359

Why does 'bundle' install production gems on my development machine?

Gemfile says:

gem 'sqlite3', :groups => [:development, :test]
gem 'mysql2', :group => :production

yet when I type bundle install on my development machine ALL gems are installed.

What's wrong with my setup?

Upvotes: 20

Views: 7152

Answers (1)

Mori
Mori

Reputation: 27789

The point of Bundler is to create a consistent gem environment across deployments. Gems, unfortunately, can interact even if they aren't loaded or required. So for maximum consistency, all gems should be installed, even if they aren't all required.

However, if you don't want all gems installed all the time, you can use the bundle install --without option.

Upvotes: 28

Related Questions