Tuesday, September 2, 2014

Elixir: Phoenix compilation error

I got the following error when I tried to compile master. If you get it too, just delete the _build folder.

==> plug
Compiled lib/plug.ex
Compiled lib/plug/adapters/cowboy.ex

== Compilation error on file lib/plug/conn/adapter.ex ==
** (RuntimeError) cannot compile Plug because the :cowboy application is not available. Please ensure it is listed as a dependency before the plug one.
    lib/plug/conn/adapter.ex:4: (file)
    (elixir) src/elixir_lexical.erl:17: :elixir_lexical.run/3
    (elixir) lib/kernel/parallel_compiler.ex:97: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/8

could not compile dependency plug, mix compile failed. You can recompile this dependency with `mix deps.compile plug` or update it with `mix deps.update plug`

--------------------------------------------------------------------------
When you get the error below, remove the deps `rm -r deps` and redownload them again `mix deps.get`

== Compilation error on file lib/postgrex/types.ex ==
** (CompileError) lib/postgrex/types.ex:6: module Decimal is not loaded and could not be found
    (elixir) src/elixir_exp.erl:104: :elixir_exp.expand/2
    (stdlib) lists.erl:1352: :lists.mapfoldl/3
    (stdlib) lists.erl:1353: :lists.mapfoldl/3
    (elixir) src/elixir_exp.erl:49: :elixir_exp.expand/2
    (elixir) src/elixir.erl:206: :elixir.quoted_to_erl/3
    (elixir) src/elixir.erl:175: :elixir.erl_eval/3