Steps to reproduce
rails new foo -d mysql
cd ./foo
edit config/database.yml # Enter root password
bin/rails db:create:all
Expected behavior
Databases are being created.
Actual behavior
Error:
ActiveRecord::NoDatabaseError: We could not find your database: foo_development. Available database configurations can be found in config/database.yml file. (ActiveRecord::NoDatabaseError)
To resolve this error:
- Did you create the database for this app, or delete it? You may need to create your database.
- Has the database name changed? Check your database.yml config has the correct database name.
To create your database, run:
bin/rails db:create
After calling bin/rails db:create, bin/rails db:create:all works as expected.
I am aware that db:create now also creates the test database in the development env. I'm using the db:create:all task, though, to automatically create databases for a dummy application of a Rails engine, where db:create still only creates the test database when running in CI.
System configuration
Rails version: 7.1.2 - 7.1.3
Ruby version: 3.2.2
Steps to reproduce
Expected behavior
Databases are being created.
Actual behavior
Error:
After calling
bin/rails db:create,bin/rails db:create:allworks as expected.I am aware that
db:createnow also creates the test database in the development env. I'm using thedb:create:alltask, though, to automatically create databases for a dummy application of a Rails engine, wheredb:createstill only creates the test database when running in CI.System configuration
Rails version: 7.1.2 - 7.1.3
Ruby version: 3.2.2