gpt4 book ai didi

elixir - 编译错误phoenix_ecto

转载 作者:行者123 更新时间:2023-12-02 10:02:15 24 4
gpt4 key购买 nike

我正在尝试使用当前版本的 phoenix/elixir/etc 来遵循本教程:http://learnelixir.com/blog/2014/10/30/real-time-to-do-list-with-phoenix-channel/但我收到 phoenix_ecto 的编译错误

版本如下:

[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`

最佳答案

看来您缺少 phoenix_html 依赖项,或者使用了它的不同版本。

将其添加到您的 mix.exs 文件中:

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

然后运行mix deps.get

关于elixir - 编译错误phoenix_ecto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32121578/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com