title: git push heroku master rails error
body: <p>I'm trying to push my new rails app to Heroku, but it doesn't work. I tried many things, such as:</p>
  
  <ol>
  <li>Delete the Gemfile.lock and create another one</li>
  <li>Run bundle install and bundle install --without production</li>
  <li>Reinstall the gems 'pg' and 'rails_12factor'</li>
  </ol>
  
  <p>That's what appears in the command line when I type git push heroku master:</p>
  
  <pre><code>    Counting objects: 87, done.
  Delta compression using up to 8 threads.
  Compressing objects: 100% (73/73), done.
  Writing objects: 100% (87/87), 18.46 KiB | 0 bytes/s, done.
  Total 87 (delta 8), reused 0 (delta 0)
  remote: Compressing source files... done.
  remote: Building source:
  remote: 
  remote: -----&gt; Ruby app detected
  remote: -----&gt; Compiling Ruby/Rails
  remote: -----&gt; Using Ruby version: ruby-2.0.0
  remote: -----&gt; Installing dependencies using bundler 1.9.7
  remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
  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:        Rubygems 2.0.14 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
  remote:        Installing rake 10.4.2
  remote:        Installing i18n 0.7.0
  remote:        Installing json 1.8.3
  remote:        Installing minitest 5.8.2
  remote:        Installing thread_safe 0.3.5
  remote:        Installing tzinfo 1.2.2
  remote:        Installing activesupport 4.2.4
  remote:        Installing builder 3.2.2
  remote:        Installing erubis 2.7.0
  remote:        Installing mini_portile 0.6.2
  remote:        Installing nokogiri 1.6.6.2
  remote:        Installing rails-deprecated_sanitizer 1.0.3
  remote:        Installing rails-dom-testing 1.0.7
  remote:        Installing loofah 2.0.3
  remote:        Installing rails-html-sanitizer 1.0.2
  remote:        Installing actionview 4.2.4
  remote:        Installing rack 1.6.4
  remote:        Installing rack-test 0.6.3
  remote:        Installing actionpack 4.2.4
  remote:        Installing globalid 0.3.6
  remote:        Installing activejob 4.2.4
  remote:        Installing mime-types 2.6.2
  remote:        Installing mail 2.6.3
  remote:        Installing actionmailer 4.2.4
  remote:        Installing activemodel 4.2.4
  remote:        Installing arel 6.0.3
  remote:        Installing activerecord 4.2.4
  remote:        Installing coffee-script-source 1.9.1.1
  remote:        Installing execjs 2.6.0
  remote:        Installing coffee-script 2.4.1
  remote:        Installing thor 0.19.1
  remote:        Installing railties 4.2.4
  remote:        Installing coffee-rails 4.1.0
  remote:        Installing multi_json 1.11.2
  remote:        Installing jbuilder 2.3.2
  remote:        Installing jquery-rails 4.0.5
  remote:        Using bundler 1.9.7
  remote:        Installing sprockets 3.4.0
  remote:        Installing sprockets-rails 2.3.3
  remote:        Installing rails 4.2.4
  remote:        Installing rdoc 4.2.0
  remote:        Installing sass 3.4.19
  remote:        Installing tilt 2.0.1
  remote:        Installing sass-rails 5.0.4
  remote:        Installing sdoc 0.4.1
  remote:        Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
  remote:        /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby 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_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby
  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}/
  remote:        Gem files will remain installed in /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection.
  remote:        Results logged to /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11/ext/sqlite3/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: Fetching gem metadata from https://rubygems.org/...........
  remote:        Fetching version metadata from https://rubygems.org/...
  remote:        Fetching dependency metadata from https://rubygems.org/..
  remote:        Rubygems 2.0.14 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
  remote:        Installing rake 10.4.2
  remote:        Installing i18n 0.7.0
  remote:        Installing json 1.8.3
  remote:        Installing minitest 5.8.2
  remote:        Installing thread_safe 0.3.5
  remote:        Installing tzinfo 1.2.2
  remote:        Installing activesupport 4.2.4
  remote:        Installing builder 3.2.2
  remote:        Installing erubis 2.7.0
  remote:        Installing mini_portile 0.6.2
  remote:        Installing nokogiri 1.6.6.2
  remote:        Installing rails-deprecated_sanitizer 1.0.3
  remote:        Installing rails-dom-testing 1.0.7
  remote:        Installing loofah 2.0.3
  remote:        Installing rails-html-sanitizer 1.0.2
  remote:        Installing actionview 4.2.4
  remote:        Installing rack 1.6.4
  remote:        Installing rack-test 0.6.3
  remote:        Installing actionpack 4.2.4
  remote:        Installing globalid 0.3.6
  remote:        Installing activejob 4.2.4
  remote:        Installing mime-types 2.6.2
  remote:        Installing mail 2.6.3
  remote:        Installing actionmailer 4.2.4
  remote:        Installing activemodel 4.2.4
  remote:        Installing arel 6.0.3
  remote:        Installing activerecord 4.2.4
  remote:        Installing coffee-script-source 1.9.1.1
  remote:        Installing execjs 2.6.0
  remote:        Installing coffee-script 2.4.1
  remote:        Installing thor 0.19.1
  remote:        Installing railties 4.2.4
  remote:        Installing coffee-rails 4.1.0
  remote:        Installing multi_json 1.11.2
  remote:        Installing jbuilder 2.3.2
  remote:        Installing jquery-rails 4.0.5
  remote:        Using bundler 1.9.7
  remote:        Installing sprockets 3.4.0
  remote:        Installing sprockets-rails 2.3.3
  remote:        Installing rails 4.2.4
  remote:        Installing rdoc 4.2.0
  remote:        Installing sass 3.4.19
  remote:        Installing tilt 2.0.1
  remote:        Installing sass-rails 5.0.4
  remote:        Installing sdoc 0.4.1
  remote:        
  remote:        Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
  remote:        
  remote:        /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby 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_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby
  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}/
  remote:        
  remote:        
  remote:        Gem files will remain installed in /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection.
  remote:        Results logged to /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11/ext/sqlite3/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: 
  remote:  !     Push rejected, failed to compile Ruby app
  remote: 
  remote: Verifying deploy...
  remote: 
  remote: !   Push rejected to salty-oasis-5413.
  remote: 
  To https://git.heroku.com/salty-oasis-5413.git
   ! [remote rejected] master -&gt; master (pre-receive hook declined)
  error: failed to push some refs to 'https://git.heroku.com/salty-oasis-5413.git'
  </code></pre>
  
  <p>I saw in some tutorials that the first time you execute this command, heroku asks you for a password, but in my case it didn't.</p>
  
  <p>My gem file</p>
  
  <pre><code># Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '4.2.4'
  # Use sqlite3 as the database for Active Record
  gem 'pg', '~&gt; 0.18.4'
  gem 'rails_12factor', '~&gt;0.0.3'
  
  # Use SCSS for stylesheets
  gem 'sass-rails', '~&gt; 5.0'
  # Use Uglifier as compressor for JavaScript assets
  gem 'uglifier', '&gt;= 1.3.0'
  # Use CoffeeScript for .coffee assets and views
  gem 'coffee-rails', '~&gt; 4.1.0'
  # See https://github.com/rails/execjs#readme for more supported runtimes
  # gem 'therubyracer', platforms: :ruby
  gem 'byebug',  '~&gt;6.0.2'
  gem 'web-console', '~&gt; 2.0'
  gem 'spring',   '~&gt;1.4.0'
  # 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', '~&gt; 2.0'
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', '~&gt; 0.4.0', group: :doc
  gem 'bootstrap-sass', '~&gt; 3.3', '&gt;= 3.3.5.1'
  # Use ActiveModel has_secure_password
  # gem 'bcrypt', '~&gt; 3.1.7'
  
  # Use Unicorn as the app server
  # gem 'unicorn'
  
  # Use Capistrano for deployment
  # gem 'capistrano-rails', group: :development
  
  group :development, :test do
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console
    gem 'sqlite3', '1.3.11'
  
  end
  
  group :production do
    gem 'pg', '~&gt; 0.18.4'
    gem 'rails_12factor', '~&gt;0.0.3'
  end
    # Access an IRB console on exception pages or by using &lt;%= console %&gt; in views
  
  
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  </code></pre>
  
  <p>Thanks guys.</p>