Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compilation error phoenix_ecto

I'm trying to follow this tutorial with current versions of phoenix/elixir/etc: http://learnelixir.com/blog/2014/10/30/real-time-to-do-list-with-phoenix-channel/ but I get a compilation error for phoenix_ecto

Versions are as follows:

[mariano:~/phoenix/realtime_todo]$ git remote -v
origin  https://github.com/phoenixframework/phoenix.git (fetch)
origin  https://github.com/phoenixframework/phoenix.git (push)

[mariano:~/phoenix/realtime_todo]$ git branch
* (detached from v0.10.0)
  master

[mariano:~/phoenix/realtime_todo]$ elixir -v
Elixir 1.0.5
[mariano:~/phoenix/realtime_todo]$ mix -v
Mix 1.0.5

[mariano:~/phoenix/realtime_todo]$ mix deps.compile phoenix_ecto
==> phoenix_ecto
Compiled lib/phoenix_ecto.ex
Compiled lib/phoenix_ecto/plug.ex
Compiled lib/phoenix_ecto/json.ex

== Compilation error on file lib/phoenix_ecto/html.ex ==
** (CompileError) lib/phoenix_ecto/html.ex:7: unknown key :impl for struct Phoenix.HTML.Form
    (elixir) src/elixir_map.erl:182: :elixir_map."-assert_struct_keys/5-lc$^0/1-0-"/5
    (elixir) src/elixir_map.erl:59: :elixir_map.translate_struct/4
    (elixir) src/elixir_clauses.erl:36: :elixir_clauses.clause/7
    (elixir) src/elixir_def.erl:178: :elixir_def.translate_clause/7
    (elixir) src/elixir_def.erl:167: :elixir_def.translate_definition/8

could not compile dependency phoenix_ecto, mix compile failed. You can recompile this dependency with `mix deps.compile phoenix_ecto` or update it with `mix deps.update phoenix_ecto`
like image 456
marianov Avatar asked May 24 '26 06:05

marianov


1 Answers

It looks like you are either missing the phoenix_html dependency or using a different version of it.

Add it to your mix.exs file:

defp deps do
  [{:phoenix, "~> 0.17.0"},
   {:ecto, "~> 0.16.0"},
   {:phoenix_ecto, "~> 1.1.0"},
   {:postgrex, ">= 0.0.0"},
   {:phoenix_html, "~> 2.1.0"},
   {:phoenix_live_reload, "~> 1.0", only: :dev}]
end

Then run mix deps.get

like image 86
Gazler Avatar answered May 26 '26 23:05

Gazler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!