Q:

Heroku rejecting my git push due to SQLite3

Heroku keeps rejecting my pushes with this error:
 Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !     
remote:  !     Detected sqlite3 gem which is not supported on Heroku.
remote:  !     https://devcenter.heroku.com/articles/sqlite3
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.

I realize this is a common problem (I have looked at other threads) I have tried removing the sqlite3 gem from my Gemfile, I ran a bundle install and made sure that the sqlite3 gem was also out of my Gemfile.lock (which it was).
I also got rid of all references to sqlite3 from my database.yml and replaced them with Postgres:
#
default: &default
  adapter: postgresql
  encoding: unicode
  database: store_development
  pool: 5
  timeout: 5000

development:
    adapter: postgresql
    encoding: unicode
    database: store_development

# 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: postgresql
  encoding: unicode
  database: store_test

production:
  adapter: postgresql
  encoding: unicode
  database: store_development

I'm lost any suggestions?
Here is my gemfile: 
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.1'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
#bcrypt for for encrpytion
gem 'bcrypt', '~> 3.1', '>= 3.1.11'
#byebug
gem 'byebug', '~> 9.0', '>= 9.0.5'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# 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', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
#paperclip for easy upload management
gem 'paperclip', '~> 4.3', '>= 4.3.6'
#bootstrap-sass
gem 'bootstrap-sass', '~> 3.3', '>= 3.3.6'
#searchkick
gem 'searchkick', '~> 1.2', '>= 1.2.1'
#paginate
gem 'will_paginate', '~> 3.1'
#paginate for bootstrap
gem 'bootstrap-will_paginate', '~> 0.0.10'
#Carrierwave
#gem 'carrierwave'
#Cloudinary
#gem 'cloudinary'
#Paperclip forcloudinary
gem 'paperclip-cloudinary'
#elasticsearch stuff
gem 'elasticsearch-rails'
gem 'elasticsearch-model'
#bonsi
gem 'bonsai-elasticsearch-rails', '~> 0.0.4'

group :development, :test do

end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  #db stuff
  gem 'sqlite3'

end
group :production do
  gem 'rails_12factor'
  gem 'puma', '~> 3.4'
  #postgresql
  gem 'pg'
end

I'll also include the whole Heroku rejection just for reference: 
    remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
remote: -----> Installing dependencies using bundler 1.11.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        Fetching gem metadata from https://rubygems.org/.........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Using i18n 0.7.0
remote:        Using rake 11.1.2
remote:        Using json 1.8.3
remote:        Using minitest 5.8.4
remote:        Using thread_safe 0.3.5
remote:        Using builder 3.2.2
remote:        Using erubis 2.7.0
remote:        Using mini_portile2 2.0.0
remote:        Using rack 1.6.4
remote:        Using mime-types-data 3.2016.0221
remote:        Using arel 6.0.3
remote:        Using execjs 2.6.0
remote:        Using aws_cf_signer 0.1.3
remote:        Using bcrypt 3.1.11
remote:        Using bonsai-elasticsearch-rails 0.0.4
remote:        Using sass 3.4.22
remote:        Using will_paginate 3.1.0
remote:        Using coffee-script-source 1.10.0
remote:        Using thor 0.19.1
remote:        Using concurrent-ruby 1.0.1
remote:        Using orm_adapter 0.5.0
remote:        Using multi_json 1.11.2
remote:        Using multipart-post 2.0.0
remote:        Using hashie 3.4.3
remote:        Using elasticsearch-rails 0.1.9
remote:        Using mimemagic 0.3.0
remote:        Using pg 0.18.4
remote:        Using bundler 1.11.2
remote:        Using rails_serve_static_assets 0.0.5
remote:        Using rails_stdout_logging 0.0.5
remote:        Using tilt 2.0.2
remote:        Using rdoc 4.2.2
remote:        Using tzinfo 1.2.2
remote:        Using nokogiri 1.6.7.2
remote:        Using mime-types 3.0
remote:        Using autoprefixer-rails 6.3.6
remote:        Using uglifier 3.0.0
remote:        Using rack-test 0.6.3
remote:        Using warden 1.2.6
remote:        Using bootstrap-will_paginate 0.0.10
remote:        Using coffee-script 2.4.1
remote:        Using sprockets 3.6.0
remote:        Using elasticsearch-api 1.0.17
remote:        Using faraday 0.9.2
remote:        Using rails_12factor 0.0.3
remote:        Using sdoc 0.4.1
remote:        Using activesupport 4.2.5.1
remote:        Using loofah 2.0.3
remote:        Using mail 2.6.4
remote:        Using rest-client 1.6.7
remote:        Using bootstrap-sass 3.3.6
remote:        Using elasticsearch-transport 1.0.17
remote:        Using rails-deprecated_sanitizer 1.0.3
remote:        Using globalid 0.3.6
remote:        Using activemodel 4.2.5.1
remote:        Using climate_control 0.0.3
remote:        Using jbuilder 2.4.1
remote:        Using rails-html-sanitizer 1.0.3
remote:        Using cloudinary 1.2.0
remote:        Using rails-dom-testing 1.0.7
remote:        Using elasticsearch 1.0.17
remote:        Using activejob 4.2.5.1
remote:        Using cocaine 0.5.8
remote:        Using paperclip-cloudinary 1.1.0
remote:        Using actionview 4.2.5.1
remote:        Using elasticsearch-model 0.1.9
remote:        Using activerecord 4.2.5.1
remote:        Using searchkick 1.2.1
remote:        Using paperclip 4.3.6
remote:        Using actionpack 4.2.5.1
remote:        Using actionmailer 4.2.5.1
remote:        Using railties 4.2.5.1
remote:        Using sprockets-rails 3.0.4
remote:        Using coffee-rails 4.1.1
remote:        Using responders 2.1.2
remote:        Using jquery-rails 4.1.1
remote:        Using rails 4.2.5.1
remote:        Using sass-rails 5.0.4
remote:        Using turbolinks 2.5.3
remote:        Using devise 4.0.0
remote:        Installing sqlite3 1.3.11 with native extensions
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/ruby-2.2.4/bin/ruby -r ./siteconf20160801-197-lz2bsz.rb extconf.rb
remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote:        'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote:        and check your shared library search path (the
remote:        location where your sqlite3 shared library is located).
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
remote:        --with-sqlite3-dir
remote:        --without-sqlite3-dir
remote:        --with-sqlite3-include
remote:        --without-sqlite3-include=${sqlite3-dir}/include
remote:        --with-sqlite3-lib
remote:        --without-sqlite3-lib=${sqlite3-dir}/lib
remote:        extconf failed, exit code 1
remote:        Gem files will remain installed in /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.11 for inspection.
remote:        Results logged to /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.11/gem_make.out
remote:        An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote:        Bundler Output: Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote:        Fetching gem metadata from https://rubygems.org/.........
remote:        Fetching version metadata from https://rubygems.org/...
remote:        Fetching dependency metadata from https://rubygems.org/..
remote:        Using i18n 0.7.0
remote:        Using rake 11.1.2
remote:        Using json 1.8.3
remote:        Using minitest 5.8.4
remote:        Using thread_safe 0.3.5
remote:        Using builder 3.2.2
remote:        Using erubis 2.7.0
remote:        Using mini_portile2 2.0.0
remote:        Using rack 1.6.4
remote:        Using mime-types-data 3.2016.0221
remote:        Using arel 6.0.3
remote:        Using execjs 2.6.0
remote:        Using aws_cf_signer 0.1.3
remote:        Using bcrypt 3.1.11
remote:        Using bonsai-elasticsearch-rails 0.0.4
remote:        Using sass 3.4.22
remote:        Using will_paginate 3.1.0
remote:        Using coffee-script-source 1.10.0
remote:        Using thor 0.19.1
remote:        Using concurrent-ruby 1.0.1
remote:        Using orm_adapter 0.5.0
remote:        Using multi_json 1.11.2
remote:        Using multipart-post 2.0.0
remote:        Using hashie 3.4.3
remote:        Using elasticsearch-rails 0.1.9
remote:        Using mimemagic 0.3.0
remote:        Using pg 0.18.4
remote:        Using bundler 1.11.2
remote:        Using rails_serve_static_assets 0.0.5
remote:        Using rails_stdout_logging 0.0.5
remote:        Using tilt 2.0.2
remote:        Using rdoc 4.2.2
remote:        Using tzinfo 1.2.2
remote:        Using nokogiri 1.6.7.2
remote:        Using mime-types 3.0
remote:        Using autoprefixer-rails 6.3.6
remote:        Using uglifier 3.0.0
remote:        Using rack-test 0.6.3
remote:        Using warden 1.2.6
remote:        Using bootstrap-will_paginate 0.0.10
remote:        Using coffee-script 2.4.1
remote:        Using sprockets 3.6.0
remote:        Using elasticsearch-api 1.0.17
remote:        Using faraday 0.9.2
remote:        Using rails_12factor 0.0.3
remote:        Using sdoc 0.4.1
remote:        Using activesupport 4.2.5.1
remote:        Using loofah 2.0.3
remote:        Using mail 2.6.4
remote:        Using rest-client 1.6.7
remote:        Using bootstrap-sass 3.3.6
remote:        Using elasticsearch-transport 1.0.17
remote:        Using rails-deprecated_sanitizer 1.0.3
remote:        Using globalid 0.3.6
remote:        Using activemodel 4.2.5.1
remote:        Using climate_control 0.0.3
remote:        Using jbuilder 2.4.1
remote:        Using rails-html-sanitizer 1.0.3
remote:        Using cloudinary 1.2.0
remote:        Using rails-dom-testing 1.0.7
remote:        Using elasticsearch 1.0.17
remote:        Using activejob 4.2.5.1
remote:        Using cocaine 0.5.8
remote:        Using paperclip-cloudinary 1.1.0
remote:        Using actionview 4.2.5.1
remote:        Using elasticsearch-model 0.1.9
remote:        Using activerecord 4.2.5.1
remote:        Using searchkick 1.2.1
remote:        Using paperclip 4.3.6
remote:        Using actionpack 4.2.5.1
remote:        Using actionmailer 4.2.5.1
remote:        Using railties 4.2.5.1
remote:        Using sprockets-rails 3.0.4
remote:        Using coffee-rails 4.1.1
remote:        Using responders 2.1.2
remote:        Using jquery-rails 4.1.1
remote:        Using rails 4.2.5.1
remote:        Using sass-rails 5.0.4
remote:        Using turbolinks 2.5.3
remote:        Using devise 4.0.0
remote:        Installing sqlite3 1.3.11 with native extensions
remote:        
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/ruby-2.2.4/bin/ruby -r ./siteconf20160801-197-lz2bsz.rb extconf.rb
remote:        checking for sqlite3.h... no
remote:        sqlite3.h is missing. Try 'port install sqlite3 +universal',
remote:        'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote:        and check your shared library search path (the
remote:        location where your sqlite3 shared library is located).
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:        
remote:        Provided configuration options:
remote:        --with-opt-dir
remote:        --without-opt-dir
remote:        --with-opt-include
remote:        --without-opt-include=${opt-dir}/include
remote:        --with-opt-lib
remote:        --without-opt-lib=${opt-dir}/lib
remote:        --with-make-prog
remote:        --without-make-prog
remote:        --srcdir=.
remote:        --curdir
remote:        --ruby=/tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
remote:        --with-sqlite3-dir
remote:        --without-sqlite3-dir
remote:        --with-sqlite3-include
remote:        --without-sqlite3-include=${sqlite3-dir}/include
remote:        --with-sqlite3-lib
remote:        --without-sqlite3-lib=${sqlite3-dir}/lib
remote:        
remote:        extconf failed, exit code 1
remote:        
remote:        Gem files will remain installed in /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/bundle/ruby/2.2.0/gems/sqlite3-1.3.11 for inspection.
remote:        Results logged to /tmp/build_650c9daea9707f0830f7e2ecbfc558e2/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.11/gem_make.out
remote:        An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !     
remote:  !     Detected sqlite3 gem which is not supported on Heroku.
remote:  !     https://devcenter.heroku.com/articles/sqlite3
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to professor-ratings.
remote: 

Could the problem be with the build configuration?  How can I change that?'

A:

Using SQLITE3 is fine in development, Heroku just needs PG for production, your gemfile should look something like this:
group :development, :test do
    gem 'sqlite3'
end

group :production do
    gem 'pg'
end

You may need to reset your database (rails db:reset / rake db:reset depending on rails version). Then you can just run bundle install --without production

