升级Elixir后,“Phoenix.HTML.Engine.init / 1未定义或私有”和“Plug.Conn .__ struct __ / 1未定义”等错误

时间:2016-06-21 15:06:54

标签: elixir phoenix-framework

我升级到Elixir 1.3。当我尝试使用mix phoenix.server启动我的Phoenix应用时出现错误:

== Compilation error on file web/views/page_view.ex ==
** (UndefinedFunctionError) function Phoenix.HTML.Engine.init/1 is undefined or private

尝试通过升级lib来修复它,我遇到了其他错误:

** (CompileError) lib/poison/parser.ex:11: Poison.SyntaxError.__struct__/1 is undefined, cannot expand struct Poison.SyntaxError

== Compilation error on file lib/plug/test.ex ==
** (CompileError) lib/plug/test.ex:53: Plug.Conn.__struct__/1 is undefined, cannot expand struct Plug.Conn
    (stdlib) lists.erl:1353: :lists.mapfoldl/3

有什么想法吗?

1 个答案:

答案 0 :(得分:4)

似乎为我修复的是迫使依赖项重新编译:

mix deps.compile --force

如果在尝试运行测试时遇到错误,请尝试:

MIX_ENV=test mix deps.compile --force