Postgres on Rails FATAL: database does not exist

后端 未结 4 2019
离开以前
离开以前 2020-12-28 12:45

I\'ve reinstalled Postgres (9.2.4) and I\'m having trouble getting it set back up with Rails 3.2.11. I did:

brew install postgresql
initdb /usr/local/var/po         


        
相关标签:
4条回答
  • 2020-12-28 13:18

    I was having a similar problem. I checked different websites and tried what they suggested but didn't work. Then I tried what you suggested. rake db:create:all and rake db:migrate it worked for me. Thank you!

    0 讨论(0)
  • 2020-12-28 13:34

    You need to create the databases first. Run rake db:create:all

    Also make sure your yml file is set up correctly for postgres.

    0 讨论(0)
  • 2020-12-28 13:34

    db:create:all and db:migrate did not work for me first. I changed my database name from development.pg to developmentpg in myapp/config/database.yml file:

    database: db/developmentpg

    and then rake db:create:all and rake db:migrate, it worked for me.

    Thank you

    0 讨论(0)
  • 2020-12-28 13:38

    I tried running rake db:create:all, which didn't work. However, running bundle exec rake db:create:all worked for me.

    Hope this helps!

    0 讨论(0)
提交回复
热议问题