17:55:35.631 [error] GenServer #PID<0.215.0> terminating
** (RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as they may contain sensitive data such
as database credentials.
** (Mix) The database for HelloPhoenix.Repo couldn’t be created: an exception was raised:
** (RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as they may contain sensitive data such
as database credentials.
I had to google to find how to update that setting and it seems to be a common question. Based on another ElixirForum answer I updated config.exs thus
> # This file is responsible for configuring your application
> # and its dependencies with the aid of the Mix.Config module.
> #
> # This configuration file is loaded before any dependency and
> # is restricted to this project.
> use Mix.Config
>
> # General application configuration
> config :hello_phoenix,
> ecto_repos: [HelloPhoenix.Repo]
>
> config :hello_phoenix, HelloPhoenix.Repo,
> show_sensitive_data_on_connection_error: true
>
> # Configures the endpoint
> config :hello_phoenix, HelloPhoenix.Endpoint,
> url: [host: "localhost"],
> secret_key_base: "+zOPUugL3TISBlX4gNLI9tMhjgxP94HKofCcGqooGzkgoUCojlUJJal7QMacPgGw",
> render_errors: [view: HelloPhoenix.ErrorView, accepts: ~w(html json)],
> pubsub: [name: HelloPhoenix.PubSub,
> adapter: Phoenix.PubSub.PG2]
>
> # Configures Elixir's Logger
> config :logger, :console,
> format: "$time $metadata[$level] $message\n",
> metadata: [:request_id]
>
> # Import environment specific config. This must remain at the bottom
> # of this file so it overrides the configuration defined above.
> import_config "#{Mix.env}.exs"
and still I get the following error on mix ecto.create
21:03:52.509 [error] GenServer #PID<0.327.0> terminating
** (RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as
they may contain sensitive data such as database credentials.
(postgrex 0.12.2) lib/postgrex/utils.ex:40: Postgrex.Utils.parse_version/1
(postgrex 0.12.2) lib/postgrex/protocol.ex:497: Postgrex.Protocol.bootstrap_send/4
(postgrex 0.12.2) lib/postgrex/protocol.ex:353: Postgrex.Protocol.handshake/2
(db_connection 1.1.3) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
(connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.11.2) proc_lib.erl:249: :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:
** (RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as
they may contain sensitive data such as database credentials.
(postgrex 0.12.2) lib/postgrex/utils.ex:40: Postgrex.Utils.parse_version/1
(postgrex 0.12.2) lib/postgrex/protocol.ex:497: Postgrex.Protocol.bootstrap_send/4
(postgrex 0.12.2) lib/postgrex/protocol.ex:353: Postgrex.Protocol.handshake/2
(db_connection 1.1.3) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
(connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
(stdlib 3.11.2) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Because there is a lot more of dated dependencies, probably something puts a constraint on postgrex that makes it unable to update.
If you put {:postgrex, "~> 0.13"} in your mix.exs and then mix do deps.unlock postgrex, deps.update postgrex again, it will tell you where constraints are comming from.
PS: Also do not put >= as a version constraint unless you really know what you are doing.
PPS: ecto 2.0.6 had a constraint on postgrex that basically narrows it to 0.12.x.
PPPS: You really should ditch that old, outdated and deprecated guide in favor of the new hexdocs hosted: https://hexdocs.pm/phoenix/up_and_running.html, how have you actually found that other one? Those aren’t linked from the phoenix homepage anymore for years…
As I said already, the best is to ditch the guide you follow, and remove the empty project you have so far. Then you mix archive.uninstall phoenix_new, as that is deprecated and only creates outdated project skeletons.
Then you start again by following the new guide, updating all those dependencies like NodeJS, Elixir, Erlang while you go, though at least the latter two usually do not need extra updating.
sorry i did not read the 3rd PS. I will do that and follow the new guide on hexdocs. thanks again.
$ mix archive.uninstall phoenix_new
Are you sure you want to uninstall /home/max/.mix/archives/phoenix_new? [Yn] Y
Done!
UPDATE: I followed the Install instructions and Up and Running at hexdocs.pm and saw the Phoenix Framework page being served on localhost. No hiccups even with ecto. thanks for the assistance.