We are using devise's devise_for in routes which accesses the database.
When setting up CI environment rake db:create fails because it loads the environment, which includes routes, which fails trying to access the database.
Steps to reproduce
- create a new project
- add to routes.rb:
ActiveRecord::Base.connection.table_exists? :users
rake db:create
Expected behavior
A database is created
Actual behavior
Rake fails with "database doesn't exist"
System configuration
Rails version: 5.2.x
Ruby version: doesn't matter