On linux, can't ecto.create, ecto.migrate or even mix phx.server in a app developed in Mac

Hi everybody.
I’m quite new to Elixir, I’m in my first steps.

I successfully build an app in a Mac computer using Phoenix.
When I git clone, mix deps.get, everything seems fine.

When I run mix ecto.create, it shows:

21:20:32.077 [error] GenServer #PID<0.211.0> terminating
** (CaseClauseError) no case clause matching: [10, 10, 10, 18, 4, 1]
    (postgrex) lib/postgrex/utils.ex:69: Postgrex.Utils.parse_version/1
    (postgrex) lib/postgrex/protocol.ex:641: Postgrex.Protocol.bootstrap_send/6
    (postgrex) lib/postgrex/protocol.ex:475: Postgrex.Protocol.handshake/2
    (db_connection) lib/db_connection/connection.ex:134: 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 TicketSender.Repo couldn't be created: an exception was raised:
    ** (CaseClauseError) no case clause matching: [10, 10, 10, 18, 4, 1]
        (postgrex) lib/postgrex/utils.ex:69: Postgrex.Utils.parse_version/1
        (postgrex) lib/postgrex/protocol.ex:641: Postgrex.Protocol.bootstrap_send/6
        (postgrex) lib/postgrex/protocol.ex:475: Postgrex.Protocol.handshake/2
        (db_connection) lib/db_connection/connection.ex:134: 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

I have postgresql installed and everything seems fine with the installation.

Could anyone help me, please?

Try updating Postgrex with mix deps.update postgrex.

While you’re at it, run mix hex.outdated to find outdated packages and update those.

4 Likes

To be specific, the version of postgrex that you’re using does not support Postgres 10

5 Likes

Your explanation was also important. I’m still learning about Phoenix. Thank you so much sir

1 Like

Thank you very much. That worked!

1 Like