Deploying RoR app to Heroku with SQLite 3 fails

Heroku doesn't support SQLite databases. You need to use PostgreSQL on production, as I also explained in this post.

group :production do
  gem "pg"
end

group :development, :test do
  gem "sqlite3", "~> 1.3.0"
end

Actually, it's recommended to use in development/test an environment as close as possible to production. Therefore, I suggest you to switch all your environments to PostgreSQL.

# replace gem "sqlite3" with
gem "pg"

Simone Carletti is correct and so is Joost. You only need to group the sqlite3 gem or remove it entirely from your Gemfile. Heroku just needs to know that you don't want to use sqlite3 for production

So this:

...
group :development, :test do
  gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end
...

Or this:

...
#No reference to sqlite3-ruby
...

If you remove the reference entirely you will probably mess up your local db though


After banging my head against this problem, I realized I was pushing the master branch of my repo to heroku, while I was making all of my postgres changes in my deploy-postgres branch of my repo!

I merged my deploy-postgres branch with my local master [git checkout master; git merge deploy-postgres] and then could run git push heroku master as per the heroku documentation.