Home>

As the title says, Detected sqlite3 gem which is not supported on Heroku: I'm having trouble deploying to heroku with an error.

I would appreciate it if you could teach me.
Thanks for your cooperation.

~ Coping flow ~
-Check if the current directory is in the application creation hierarchy.
-Log in to heroku and create an app.
-Fixed to use sqlite3 for development environment and pg for production environment in gemfile. (The code is listed below)
・ Bundle installed
-Modified production of datebase.yml to postgresql. (The code is listed below)
-Git add -A, git committed.
-Deployment failed with git push heroku master. Detected sqlite3 gem which is not supported on Heroku: An error has occurred.
・ I searched on the internet and tried various things, but I couldn't solve it.

source'https://rubygems.org'
git_source (: github) {| repo | "https://github.com/#{repo}.git"}
ruby '2.6.6'
gem'rails','~>6.0.3','>= 6.0.3.3'
gem'puma','~>4.1'
gem'sass-rails','>= 6'
gem'webpacker','~>4.0'
gem'turbolinks','~>5'
gem'jbuilder','~>2.7'
gem'bootsnap','>= 1.4.2', require: false
group: development,: test do
  gem'sqlite3'
  gem'byebug', platforms: [: mri,: mingw,: x64_mingw]
end
group: development do
  gem'web-console','>= 3.3.0'
  gem'listen','~>3.2'
  gem'spring'
  gem'spring-watcher-listen','~>2.0.0'
end
group: test do
  gem'capybara','>= 2.15'
  gem'selenium-webdriver'
  gem'webdrivers'
end
group: production do
  gem'pg'
end
gem'tzinfo-data'

database.yml

default:&default
  adapter: sqlite3
  pool:<% = ENV.fetch ("RAILS_MAX_THREADS") {5}%>
  timeout: 5000
development:
<<: * default
  database: db/development.sqlite3
test: test:
<<: * default
  database: db/test.sqlite3
production:
<<: * default
  adapter: postgresql
  encoding: unicode
  pool: 5
  • Answer # 1

    This case has been resolved!
    Since I was developing on the ssl branch, not git push heroku master
    I deployed it with git push heroku ssl: master --force and it was successful.

  • Answer # 2

    Is Detected sqlite3 gem which is not supported on Heroku helpful?

    Even with the same SQL, there are so many dialects depending on the database and version, so the development environment and production environment will fail unless the same version of the same database is used.