elixirphoenix-frameworkecto

The database for Rumbl.Repo couldn't be created: killed


I created a new project using mix phx.new rumbl which worked fine. Then I went to the project folder using cd rumbl. After that I tried to run mix ecto.create which resulted in this error message:

D:\Elixir\Projects\rumbl>mix ecto.create

10:35:16.370 [error] GenServer #PID<0.212.0> terminating
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
    (db_connection) lib/db_connection/connection.ex:84: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Rumbl.Repo couldn't be created: killed

Yesterday mix ecto.create worked, but now it gives this error. I have installed the dependencies without any problems Elixir version: 1.8.2 phoenix version: 1.4.6

I have tried reopening the command prompt, restarting my laptop and using a different folder


Solution

  • Your Postgres database is not running or not open on this port.

    You should install postgres and start it.

    If you don't want to handle with postgres issues or are not familiar with that, take a look on this post about how to have it running on a docker container.