HelloPhoenix.Repo couldn't be created: an exception was raised

377 views
Skip to first unread message

leotr...@gmail.com

unread,
Apr 13, 2017, 10:31:37 AM4/13/17
to phoenix-talk

Hello,


Following the up and running guide on Mac and get:


leotreasure$ mix ecto.create


22:30:34.305 [error] GenServer #PID<0.193.0> terminating

** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused

    (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2

    (connection) lib/connection.ex:622: Connection.enter_connect/5

    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Last message: nil

State: Postgrex.Protocol

** (Mix) The database for HelloPhoenix.Repo couldn't be created: an exception was raised:

    ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused

        (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2

        (connection) lib/connection.ex:622: Connection.enter_connect/5

        (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Pedro Medeiros

unread,
Apr 13, 2017, 10:37:50 AM4/13/17
to phoeni...@googlegroups.com
Is there a posgres instance running locally?

One is needed to the quick startup with a database.

--
You received this message because you are subscribed to the Google Groups "phoenix-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phoenix-talk+unsubscribe@googlegroups.com.
To post to this group, send email to phoeni...@googlegroups.com.
Visit this group at https://groups.google.com/group/phoenix-talk.
To view this discussion on the web visit https://groups.google.com/d/msgid/phoenix-talk/5bcfff2d-c951-4065-bc25-31cd0bda6b52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Pedro Henrique de Souza Medeiros
----------------------------------
Cel: +55 (61) 9197-0993
Email: pedr...@gmail.com

Beautiful is better than ugly,
Explicit is better than implicit,
Simple is better than complex,
Complex is better than complicated.

The Zen of Python, by Tim Peters

Leo Treasure

unread,
Apr 13, 2017, 10:53:28 AM4/13/17
to phoenix-talk
No, how can I run run a postgres instance?

When I type postgres I get:

postgres does not know where to find the server configuration file.

You must specify the --config-file or -D invocation option or set the PGDATA environment variable.


On Thursday, 13 April 2017 22:37:50 UTC+8, Pedro Medeiros wrote:
Is there a posgres instance running locally?

One is needed to the quick startup with a database.
On Thu, Apr 13, 2017 at 11:31 AM, <leotr...@gmail.com> wrote:

Hello,


Following the up and running guide on Mac and get:


leotreasure$ mix ecto.create


22:30:34.305 [error] GenServer #PID<0.193.0> terminating

** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused

    (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2

    (connection) lib/connection.ex:622: Connection.enter_connect/5

    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Last message: nil

State: Postgrex.Protocol

** (Mix) The database for HelloPhoenix.Repo couldn't be created: an exception was raised:

    ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused

        (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2

        (connection) lib/connection.ex:622: Connection.enter_connect/5

        (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

--
You received this message because you are subscribed to the Google Groups "phoenix-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phoenix-talk...@googlegroups.com.

Pedro Medeiros

unread,
Apr 13, 2017, 11:14:06 AM4/13/17
to phoeni...@googlegroups.com
If you are running on Mac I highly recommend you to use the Postgres App https://postgresapp.com/ just install and run it. On other OSs you can search here https://www.postgresql.org/download/ .

To unsubscribe from this group and stop receiving emails from it, send an email to phoenix-talk+unsubscribe@googlegroups.com.

To post to this group, send email to phoeni...@googlegroups.com.
Visit this group at https://groups.google.com/group/phoenix-talk.

For more options, visit https://groups.google.com/d/optout.

Hassan Schroeder

unread,
Apr 13, 2017, 11:38:15 AM4/13/17
to phoeni...@googlegroups.com
On Thu, Apr 13, 2017 at 7:53 AM, Leo Treasure <leotr...@gmail.com> wrote:

> When I type postgres I get:
>
> postgres does not know where to find the server configuration file.
>
> You must specify the --config-file or -D invocation option or set the PGDATA
> environment variable.

Read that message and do what it says :-)

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Leo Treasure

unread,
Apr 13, 2017, 11:45:48 AM4/13/17
to phoenix-talk
Thanks! That did the trick!
Reply all
Reply to author
Forward
0 new messages