I\'m following this tutorial, but it fails when I try to push to Heroku. It seems \"sqlite3.h\" is missing. I\'m new to development so I\'m not sure what information will
Heroku uses postgresql so you want to remove sqlite3 or move it into a development group in your Gemfile.
Check you Gemfile.lock for any other gems that may have dependencies on sqlite3, as this can also cause problems.
gem 'sqlite3', :group => [:development, :test]
group :production do
gem 'pg'
end
Gemfile
as above Gemfile.lock
bundle install --without production
git add .
git commit -am "bundle updating sqlite3"
git push heroku master
What happened to me was, I was following along the Heroku tutorial and when I used git push heroku master
it was pushing from my latest Git commit (obviously!)
What I forgot was that in the eyes of Git, I was still using sqlite in the gemfile! Silly me!
So I used git add .
followed by a git commit -m "Changed to Postgres."
so Git knew about these changes. Pushing after that worked fine for me.
Yes, as these answers suggest, most of the time you will want to avoid using SQLite in production due to the constraints of the Heroku platform. However, you may have a perfectly acceptable use case (ex. read-only config) for using SQLite anyway. My recommendation is to:
Add the heroku-buildpack-apt buildpack
Add to your Aptfile
:
libsqlite3-dev
libsqlite3-0
I had a similar problem and I wasn't even using sqlite3 for anything but after removing it from the gem file I still got that error
what solved it for me was a commit command
git commit -am
that I found on this tutorial