I am trying to deploy a new version on my rails app (with postgres database). At the release
stage of the deploy, I get the following error:
ActiveRecord::NoDatabaseError: FATAL: database "my-app-db" does not exist
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.3.1/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `rescue in new_client'
This, despite my app having a set DATABASE_URL
secret, the my-app-db
existing and seemingly attached to the app as I can log on and use the currently deployed version of my app.
I can also connect to the database and view the current production data:
flyctl postgres connect -a my-app-db
The release command is standard in fly.rake:
# RELEASE step:
# - changes to the filesystem made here are DISCARDED
# - full access to secrets, databases
# - failures here prevent deployment
task :release => 'db:migrate'
I’m at a loss as to what could be missing here.