Database "discourse_development" does not exist

After latest git pull update I’m trying to create database with rake db:create and getting this:

rake aborted!
ActiveRecord::NoDatabaseError: FATAL:  database "discourse_development" does not exist
/vagrant/discourse/lib/site_settings/db_provider.rb:61:in `table_exists?'
/vagrant/discourse/lib/site_settings/db_provider.rb:16:in `all'
/vagrant/discourse/lib/site_settings/defaults_provider.rb:29:in `db_all'
/vagrant/discourse/lib/site_setting_extension.rb:277:in `block in refresh!'
/vagrant/discourse/lib/site_setting_extension.rb:274:in `synchronize'
/vagrant/discourse/lib/site_setting_extension.rb:274:in `refresh!'
/vagrant/discourse/lib/site_setting_extension.rb:479:in `block in setup_methods'
/vagrant/discourse/plugins/discourse-narrative-bot/plugin.rb:51:in `block in activate!'
/vagrant/discourse/lib/plugin/instance.rb:329:in `block in notify_after_initialize'
/vagrant/discourse/lib/plugin/instance.rb:327:in `each'
/vagrant/discourse/lib/plugin/instance.rb:327:in `notify_after_initialize'
/vagrant/discourse/config/application.rb:307:in `each'
/vagrant/discourse/config/application.rb:307:in `block in <class:Application>'

Of course database not exists! That’s why I trying to create it. I don’t understand…

2 Likes

Try:

bundle exec rake db:create
bundle exec rake db:migrate

You have no local database.

3 Likes

I see the same problem. It was caused by some recent changes to use rails zeitwerk. I’m looking into fixing this.

In the meantime, you can do:

$ createdb discourse_development

instead.

9 Likes

This is now fixed. I’m sorry for any inconvenience.

6 Likes