title: Rails bundle install production only
body: <p>I'm still new to rails/ruby/bundler and am a little confused.</p>
  
  <p>In our <code>config/application.rb</code> file there's this bundler segment:</p>
  
  <pre><code>if defined?(Bundler)         
    # If you precompile assets before deploying to production, use this line
    Bundler.require(*Rails.groups(:assets =&gt; %w(development test)))
    # If you want your assets lazily compiled in production, use this line
    # Bundler.require(:default, :assets, Rails.env)
  end
  </code></pre>
  
  <p>and in our <code>Gemfile</code> we use different groups, e.g.                                                                                                                                                                                    </p>
  
  <pre><code>group :development, :test do
    gem "rspec-rails", "&gt;= 2.7.0", :group =&gt; [:development, :test]
    gem 'shoulda-matchers'
    gem 'watchr'
    gem 'spork', '~&gt; 1.0rc'
    gem 'spectator'                          
    gem 'debugger'
    gem 'wirble'
  end
  </code></pre>
  
  <p>But when I run <code>RAILS_ENV=production bundle install</code> (or <code>bundle install --deployment</code>), it still installs gems from the development/test group...</p>
  
  <p>Why does this happens or how can I make this work properly?</p>