Reputation: 4389
When I try to run mix deps.get
or mix deps.compile
I get this error:
== Compilation error on file lib/phoenix_ecto/html.ex ==
** (CompileError) lib/phoenix_ecto/html.ex:3: unknown key :model for struct Ecto.Changeset
(stdlib) lists.erl:1354: :lists.mapfoldl/3
Why is this happening and how can I fix it?
Upvotes: 2
Views: 588
Reputation: 4389
You need to upgrade your dependencies like so:
{:ecto, "~> 2.0.4"},
{:phoenix_ecto, "~> 3.0.1"},
{:phoenix_html, "~> 2.6.2"},
Then run mix clean --all
and then mix deps.get
.
This error comes from your phoenix_ecto
dependency being behind your ecto
dependency. In ecto v2.0.0, changeset.model
became changeset.data
.
The code for phoenix_ecto
is still using model
on line three:
def to_form(%Ecto.Changeset{model: model, params: params} = changeset, opts) do
In this commit, phoenix_ecto
was upgraded to support the new version of ecto
.
Upvotes: 7