When I run the rake db:migrate
or run the rails s
command, I get the same error:
Error : could not connect to server:
No such file or
That means your Postgres server is not running.
Check Postgres Service status from Terminal
sudo service postgresql status
Enable Postgres Service, If not started
sudo service postgresql start
OR
sudo service postgresql restart
Now your command should work, If Postgres Service is successfully started.