0

A rails 5.2.3 (ruby 2.5.1p57) app worked perfectly locally.

I ran rake db:drop to remove it, then rake db:reset to reset, migrate and seed, and it did so perfectly.

Then, for unrelated reasons, I dropped it again in the same way but when I recreated it with rake db:reset I got the following error

rake aborted!
ActiveRecord::NoDatabaseError: FATAL:  database "appname_development" does not exist

I have tried rake db:create:all as set out here also bundle exec rake db:create as set out here and in most other answers

It appears the symptom is common, but the main antedotes don't seem to help in my case. It's also really odd that I ran the same thing moments earlier and it worked, and seemingly nothing had changed in between

stevec
  • 41,291
  • 27
  • 223
  • 311
  • 2
    What is output when you run `rake db:create` ? – Vishal May 28 '19 at 09:51
  • 1
    try deleting your schema file then run `rails db:create` – Brad May 28 '19 at 10:11
  • @Vishal your comment made me scrutinize the output more closely. It says `/config/routes.rb:8:in `block in '`. I checked the routes. I had some code in there that should have been commented out. Thanks so much – stevec May 28 '19 at 11:11

0 Answers0