Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - FATAL: database "myapp_development" does not exist

I am trying to set up my Env to use PostgreSQL with Rails and i followed the steps to install PostgreSQL from this Article

Am getting the following error

ATAL: 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
like image 295
Harsha M V Avatar asked Feb 09 '15 07:02

Harsha M V


4 Answers

Did you run rake db:create and rake db:migrate before rails server?

UPDATE

Here's all the steps you should do:

  1. cd /your/app/path
  2. bundle install
  3. bundle exec rake db:create
  4. bundle exec rake db:migrate
  5. bundle exec rails server
like image 95
scorix Avatar answered Nov 18 '22 21:11

scorix


Run

rails db:create

before running

rails db:migrate
like image 44
Arunabh Das Avatar answered Nov 18 '22 22:11

Arunabh Das


You can also create PostgreSQL database manually by using psql command prompt.

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

like image 3
Kkulikovskis Avatar answered Nov 18 '22 23:11

Kkulikovskis


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

like image 1
djadam Avatar answered Nov 18 '22 21:11

djadam