Errors of pushing rails app to Heroku error occurred while installing sqlite3, and Bundler cannot continue [duplicate] Errors of pushing rails app to Heroku error occurred while installing sqlite3, and Bundler cannot continue [duplicate] sqlite sqlite

Errors of pushing rails app to Heroku error occurred while installing sqlite3, and Bundler cannot continue [duplicate]


I don't see it in your code above, but guessing you probably have your gem 'sqlite3' at the top of your gemfile, so it is being used in all environments. Sqlite is not supported on Heroku so it has be kept out of the production group. Try the following so that you can use sqlite for development and testing and then pg on Heroku.

group :development, :test do  gem 'sqlite3'endgroup :production do  gem 'pg'end


Had the same issue. Realized that I hadn't committed my changes to Git. Once I committed it and re-pushed it to Heroku, it worked without issue.


The following worked for me on my Mac:

group :development, :test do gem 'sqlite3' endgroup :production do gem 'pg'end

And then

bundle install

but that threw up this error:

can't find the 'libpq-fe.h header *** extconf.rb failed ***

Solved this error using Homebrew as explained here - https://stackoverflow.com/a/20482221/2665896

i.e.

brew install postgresqlgem install pg

Then commit the Gemfile and Gemfile.lock to the local master.

Then git push heroku master worked like a charm.