title: Gemfile includes incorrect environment
body: <p>When I do <code>$ bundle install</code>, it attempts to get gems only meant for production, despite me being on development.</p>
  
  <p>I double checked that I'm on development: <code>echo $RAILS_ENV   # outputs "development"</code></p>
  
  <p>Here is a copy of my gem file. If I remove <code>:staging</code> in the last block, then my bundle installs correctly and ignores this group. Why would adding <code>:staging</code> cause my app to include these gems?</p>
  
  <pre><code>source 'https://rubygems.org'
  ruby '2.0.0'
  #ruby-gemset=railstutorial_rails_4_0
  
  gem 'rails', '4.0.0'
  gem 'bootstrap-sass', '~&gt; 3.0.1.0.rc'
  gem 'bcrypt-ruby', '3.0.1'
  # generates names, email addresses, and other placeholders for factories.
  gem 'faker'
  gem 'will_paginate', '3.0.4'
  gem 'bootstrap-will_paginate', '0.0.9'
  gem 'aws-sdk', '1.11.1'
  gem 'd3-rails', '~&gt;3.3.7'
  # used for file ajax uploads
  gem 'remotipart', '~&gt; 1.2'
  # used for making server side variables accessible in JS
  gem "iconv", "~&gt; 1.0.4"
  gem "roo", "~&gt; 1.13.2"
  gem 'underscore-rails'
  
  gem 'gon', '4.1.0'
  # gem "introjs-rails"
  # High voltage for static pages
  gem 'high_voltage', '~&gt; 2.0.0'
  gem "koala", "~&gt; 1.8.0rc1"
  gem 'acts_as_list'
  gem "bugsnag"
  gem 'devise'
  # EC2 server is passenger
  gem 'passenger'
  # easily create seeds
  gem 'seed_dump'
  #add crossfilter for exploring high dimensional datasets and dcjs for charts
  gem 'crossfilter-rails'
  # gem 'dcjs-rails'
  gem 'activeadmin', github: 'gregbell/active_admin'
  # Monitor site speed.
  gem 'newrelic_rpm'
  
  group :development, :test do
    gem 'sqlite3', '1.3.8'
    # rspec-rails includes RSpec itself in a wrapper to make it play nicely with Rails.
    gem 'rspec-rails'
    # replaces Rails' default fixtures for feeding test data to the test suite with much more preferable factories
    gem 'factory_girl_rails'
    # watches your application and tests and runs specs for you automatically when it detects changes.
    gem 'guard-rspec'
  end
  
  group :test do
    # runs a browser
      gem 'selenium-webdriver'
    # makes it easy to programatically simulate your users' interactions with your application
      gem 'capybara'
    # Shows growl notifications (os x only)
    gem 'growl'
    # opens your default web browser upon failed integration specs to show you what your application is rendering.
    gem 'launchy' # tims tutorial
    # helps clear out db after using selenium in tests
    gem 'database_cleaner' # tims tutorial
  end
  
  gem 'sass-rails', '4.0.1'
  gem 'uglifier', '2.1.1'
  gem 'coffee-rails', '4.0.1'
  gem 'jquery-rails', '3.0.4'
  # fuck turbolinks.
  # gem 'turbolinks', '1.1.1'
  gem 'jbuilder', '1.0.2'
  # added for resizing panes on d3fiddle pages
  gem 'jquery-ui-rails'
  # added for code highlighting on d3fiddle pages
  gem 'codemirror-rails'
  
  group :doc do
    gem 'sdoc', '0.3.20', require: false
  end
  
  group :production, :staging do
      gem 'pg', '0.15.1'
      gem 'rails_12factor', '0.0.2'
  end
  </code></pre>