Number of issues experienced trying to install Phoenix

I remember trying out elixir and phoenix about a year ago and was surprised to discover the pleasant developer experience reminiscent of the ruby ecosystem.

I couldn’t focus much on elixir over the last year, due to other commitments. A day ago I wanted to try out phoenix+elixir for a new application, but discovered that the getting started experience is no longer as pleasant.

I understand that the scope of this chat is somewhat vague and many things might not be directly related to this phoenix itself, but I wanted to highlight the issues I faced and see if I can help out with any of them (in case not already being addressed elsewhere).

To start a new application I ran:

mix phx.new cresman --no-brunch

This generates the scaffold. Now when I run mix ecto.create I get an error:

warning: retrieving the :adapter from config files for Cresman.Repo is deprecated.
Instead pass the adapter configuration when defining the module:

    defmodule Cresman.Repo do
      use Ecto.Repo,
        otp_app: :cresman,
        adapter: Ecto.Adapters.Postgres

When I make this change in repo.ex this fails again because Ecto.Adapters.Postgres isn’t compiled. So after some exploration it would appear that this module is provided by ecto_sql package.

So I add ecto_sql package to mix.exs, but now mix deps.get fails to locate the package.

Interestingly, I am prompted to add an rc version where as the github repo seems to indicate that a 3.0.0 has been published.

When I add the 3.0-pre as a dependency, I am finally able to run mix ecto.create.

But now mix phx.server won’t start because plug_cowboy is supposed to be used as a dependency instead of cowboy.

Now finally once I go and add plug_cowboy as a dependency, I am able to run the dev server.

In the default welcome page that is served, the guides link points to a non-existent page. The mailing list link points to a google groups page that has now been deprecated and filled with spam.


I hope this post doesn’t come across as an angry rant - that is not the intent. However I do believe it would help the popularity of the ecosystem if the most popular framework works out of the box.

Can you post the version of the phx.new command you used to generate the app. This should happen and from my recent experience it hasn’t happened.

You can get the version using

% mix help | grep -i phx.new
mix phx.new           # Creates a new Phoenix v1.4.0-rc.2 application
mix phx.new.ecto      # Creates a new Ecto project within an umbrella project
mix phx.new.web       # Creates a new Phoenix web project within an umbrella project
1 Like

Hmm, following the current phoenix guides (with phx.new for Phoenix v1.3.4)

https://hexdocs.pm/phoenix/installation.html#content
https://hexdocs.pm/phoenix/up_and_running.html

I’m running into an issue as well. Looks like phoenix_ecto version 3.5.0 is being pulled in, even though it is listed as retired on hex: https://hex.pm/packages/phoenix_ecto/3.5.0

jason@Jasons-MacBook-Pro-2 /p/t/hello> cat mix.lock |grep ecto
  "ecto": {:hex, :ecto, "3.0.0", "059250d96f17f9c10f524fcb09d058f566691343e90318a161cf62a48f3912a9", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, optional: false]}, {:jason, "~> 1.0", [hex: :jason, optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, optional: true]}]},
  "phoenix_ecto": {:hex, :phoenix_ecto, "3.5.0", "f72ec302589988698c096da7e8647e917fa2bb2f861c0c3739fc9d95708bacec", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, optional: false]}, {:phoenix_html, "~> 2.9", [hex: :phoenix_html, optional: true]}, {:plug, "~> 1.0", [hex: :plug, optional: false]}]},

I would expect ecto 2.2.11 with phoenix_ecto 3.4.0 to be pulled in. Not sure what the issue is. Also not sure why I don’t get a retired package warning when I run mix deps.get.

@lorefnon thanks for bringing this up! It looks like a temporary regression because Phoenix 1.4 is in RC and a new major version of Ecto (that has some minor breaking changes) was released Yesterday. I’m sure we can get this sorted out soon.

2 Likes
mix help | grep -i phx.new
mix phx.new           # Creates a new Phoenix v1.3.0 application
mix phx.new.ecto      # Creates a new Ecto project within an umbrella project
mix phx.new.web       # Creates a new Phoenix web project within an umbrella project

Yes, I see the version is 1.3.0 and not the latest rc. I assume that once the latest 1.4 is released many of these will be resolved.

1 Like

Oh I see. Unfortunate timing on my part.

2 Likes

Hi Lorefnon,

This is unfortunate timing as we are prepping a Phoenix 1.4 final release, Ecto 3.0.0 just went final, and we accidentally pushed a phoenix_ecto version which broke 1.3 apps (which has now been fixed, and retired). 1.3 apps should be fixed now, but if you are just now jumping back into things, I recommend hopping on the 1.4 RC as we should be in a final release soon:

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.4.0-rc.3

Things should settle down soon. Thanks for bearing with us!

7 Likes

The installation instructions work great for me now! Looks like the fix was to push phoenix_ecto 3.6.0 which also matches 3.2. Thanks for fixing that.

Also does anyone know why a retired package is selected to be installed? I would expect it not to be as long as it’s not specified in the mix.lock and there’s another valid version that could be used instead.

2 Likes

Thanks a lot Cris, Jason, and everyone else, for looking into this and taking the time to reply.

I tried out the rc version and it works great :slight_smile:.

2 Likes