20

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?

Meltemi
  • 37,979
  • 50
  • 195
  • 293

1 Answers1

28

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.

Mori
  • 27,279
  • 10
  • 68
  • 73
  • 4
    FWIW: I now use `bundle install --without production` on my development machine(s). It's a remembered trait so `--without production` only needs to be typed once. – Meltemi Jul 16 '13 at 19:54
  • 1
    What happens in production later on? If you only install the gems without production and it's a remembered trait, how do you install gems in production later on when you are ready to deploy? – drjorgepolanco May 15 '15 at 02:04