title: rails wants to use PG but mysql is specified
body: <p>had a working rails app and get a weird bug - rails wants to use postgresql even tho mysql adapter is specified. Everything worked 100% fine til I worked on another project that uses postgresql.</p>
  
  <p>But still, this doesn't make ANY sense. I've been on this for hours. Maybe I'm just blind, I'd appreciate the help big times.</p>
  
  <p>error msg for local testing:</p>
  
  <pre><code>bash-3.2$ rails s
  =&gt; Booting WEBrick
  =&gt; Rails 4.0.3 application starting in development on http://0.0.0.0:3000
  =&gt; Run `rails server -h` for more startup options
  =&gt; Ctrl-C to shutdown server
  Exiting
  /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/connection_specification.rb:58:in `rescue in resolve_hash_connection': Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile. (Gem::LoadError)
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/connection_specification.rb:55:in `resolve_hash_connection'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/connection_specification.rb:46:in `resolve_string_connection'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_adapters/connection_specification.rb:32:in `spec'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/connection_handling.rb:39:in `establish_connection'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/railtie.rb:176:in `block (2 levels) in &lt;class:Railtie&gt;'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:27:in `each'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activerecord-4.0.3/lib/active_record/railtie.rb:174:in `block in &lt;class:Railtie&gt;'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/initializable.rb:30:in `instance_exec'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/initializable.rb:30:in `run'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/initializable.rb:55:in `block in run_initializers'
      from /Users/mg/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
      from /Users/mg/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
      from /Users/mg/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
      from /Users/mg/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
      from /Users/mg/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each'
      from /Users/mg/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
      from /Users/mg/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/initializable.rb:54:in `run_initializers'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/application.rb:215:in `initialize!'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
      from /Users/mg/Dropbox/delightotet/delighto/config/environment.rb:16:in `&lt;top (required)&gt;'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/polyglot-0.3.4/lib/polyglot.rb:65:in `require'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/polyglot-0.3.4/lib/polyglot.rb:65:in `require'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `block in require'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:214:in `load_dependency'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.0.3/lib/active_support/dependencies.rb:229:in `require'
      from /Users/mg/Dropbox/delightotet/delighto/config.ru:3:in `block in &lt;main&gt;'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
      from /Users/mg/Dropbox/delightotet/delighto/config.ru:in `new'
      from /Users/mg/Dropbox/delightotet/delighto/config.ru:in `&lt;main&gt;'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/commands/server.rb:48:in `app'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/commands/server.rb:75:in `start'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/commands.rb:76:in `block in &lt;top (required)&gt;'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
      from /Users/mg/.rvm/gems/ruby-2.0.0-p451/gems/railties-4.0.3/lib/rails/commands.rb:71:in `&lt;top (required)&gt;'
      from bin/rails:4:in `require'
      from bin/rails:4:in `&lt;main&gt;'
  </code></pre>
  
  <p>database.yml</p>
  
  <pre><code>development:
    adapter: mysql2
    database: xxx
    user: xxx 
    password:
  
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
  test:
    adapter: mysql2
    database: xxx
    user: xxx 
    password:
  
  production:
    adapter: mysql2
    database: xxx
    user: xxx 
    password: xxx
  </code></pre>
  
  <p>My Gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '4.0.3'
  gem 'mysql2'
  
  gem 'sprockets', '2.11.0'
  gem 'mail_form'
  
  # Use SCSS for stylesheets
  gem 'sass-rails'
  
  # DROPBOX
  gem 'dropbox-sdk'
  
  # Use Uglifier as compressor for JavaScript assets
  gem 'uglifier', '&gt;= 1.3.0'
  
  # Use CoffeeScript for .js.coffee assets and views
  gem 'coffee-rails'
  
  #mailchimp
  gem 'gibbon'
  gem 'mandrill-api'
  
  gem 'net-ssh', '~&gt;2.7.0'
  
  #devise auth 
  gem 'devise'
  
  # SUPPORT PROCESSES
  gem "zendesk_api"
  
  # AFTER SALES PROCESSES
  
  # SHIPPING SOLUTIONS
  gem 'dhl-intraship'
  
  # GENERATE PDF INVOICE
  gem 'spree_print_invoice' , :git =&gt; 'https://github.com/mgreschke/spree_print_invoice.git', branch:'2-2-stable'
  
  
  # Use jquery as the JavaScript library
  gem 'jquery-rails'
  gem 'gritter'
  gem 'friendly_id'
  
  # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
  gem 'turbolinks'
  
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  gem 'jbuilder', '~&gt; 1.2'
  
  #password encryption
  gem "bcrypt-ruby", :require =&gt; "bcrypt"
  gem 'money', '6.0.1'
  
  group :doc do
    # bundle exec rake doc:rails generates the API under doc/api.
    gem 'sdoc', require: false
  end
  
  # Use ActiveModel has_secure_password
  # gem 'bcrypt-ruby', '~&gt; 3.0.0'
  
  # Use unicorn as the app server
  # gem 'unicorn'
  
  # Use Capistrano for deployment
  gem "capistrano", "2.14.2",  group: :development
  gem "mime-types", "1.25"
  gem "rake", "10.3.1"
  
  #meta tags
  gem 'meta-tags'
  # Use debugger
  # gem 'debugger', group: [:development, :test]
  gem 'spree', '2.2.1'
  gem 'spree_gateway', :git =&gt; 'https://github.com/spree/spree_gateway.git', :branch =&gt; '2-2-stable'
  gem 'spree_i18n', :github =&gt; 'spree/spree_i18n', :branch =&gt; '2-2-stable'
  </code></pre>