4
votes

Trying out phoenix and Elixir for the first time. Stuck at the very end while running the project.

mix phoenix.server

Anyone had the same problem? Here is error trace. (postgrex was added as a dependency)

** (Mix) Could not start application blog: Blog.start(:normal, []) returned an error: shutdown: failed to start child: Blog.Repo ** (EXIT) shutdown: failed to start child: Ecto.Adapters.Postgres ** (EXIT) an exception was raised: ** (RuntimeError) could not find Ecto.Adapters.Postgres.Connection.

Please verify you have added :postgrex as a dependency:

{:postgrex, ">= 0.0.0"}

And remember to recompile Ecto afterwards by cleaning the current build:

mix deps.clean ecto

            (ecto) lib/ecto/adapters/sql.ex:420: Ecto.Adapters.SQL.start_link/4
            (stdlib) supervisor.erl:343: :supervisor.do_start_child/2
            (stdlib) supervisor.erl:326: :supervisor.start_children/3
            (stdlib) supervisor.erl:292: :supervisor.init_children/2
            (stdlib) gen_server.erl:328: :gen_server.init_it/6
            (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
1

1 Answers

4
votes

This has been fixed in the latest ecto. Please run:

$ mix deps.update ecto
$ mix phoenix.server

And you should be all set