Rails - FATAL: database "myapp_development" does not exist

I am trying to configure my Env to use PostgreSQL with Rails, and I followed the steps for installing PostgreSQL from this article.

It turns out the following error

ATAL: the database "myapp_development" does not exist. Extracted source (around line # 661):

rescue ::PG::Error => error if error.message.include?("does not exist") raise ActiveRecord::NoDatabaseError.new(error.message, error) else raise end 
+7
ruby-on-rails postgresql ruby-on-rails-4
source share
5 answers

Did you rake db:create and rake db:migrate to rails server ?

UPDATE

Here are all the steps you must follow:

  • cd /your/app/path
  • bundle install
  • bundle exec rake db:create
  • bundle exec rake db:migrate
  • bundle exec rails server
+42
source share

You can also create a PostgreSQL database manually using the psql command line.

When there, connect to the local server and write "create database myapp_development"; without quotes

+3
source share

I had a similar problem. I checked different sites and tried what they suggested, but didn't work. Then I tried rake db:create:all and rake db:migrate , this worked for me. Thanks!

+1
source share

You can fix this: bundle exec rake db:setup

0
source share

Run

 rails db:create 

before launch

 rails db:migrate 
0
source share

All Articles