Skip to content

Instantly share code, notes, and snippets.

@eezis
Created October 29, 2014 19:55
Show Gist options
  • Save eezis/7b3e7718226f76981c57 to your computer and use it in GitHub Desktop.
Save eezis/7b3e7718226f76981c57 to your computer and use it in GitHub Desktop.
Elixir Does Pheonix Ecto Compilation Fix
10.29.14
I was following this tutorial: http://www.elixirdose.com/post/lets-build-web-app-with-phoenix-and-ecto
Could not mix compile
==> postgrex
warning: the dependency postgrex requires Elixir "0.15.0" but you are running on v1.0.1
Compiled lib/postgrex/binary_utils.ex
Compiled lib/postgrex/error.ex
Compiled lib/postgrex/structs.ex
lib/postgrex/types.ex:5: warning: unused import Postgrex.BinaryUtils
== Compilation error on file lib/postgrex/types.ex ==
** (CompileError) lib/postgrex/types.ex:97: cannot invoke local nil?/1 inside guard
(stdlib) lists.erl:1352: :lists.mapfoldl/3
(elixir) src/elixir_clauses.erl:53: :elixir_clauses.translate_guard/4
(elixir) src/elixir_clauses.erl:49: :elixir_clauses."-guards/4-lc$^0/1-0-"/4
(elixir) src/elixir_clauses.erl:39: :elixir_clauses.clause/7
(elixir) src/elixir_clauses.erl:82: anonymous fn/5 in :elixir_clauses.do_clauses/4
could not compile dependency postgrex, mix compile failed. You can recompile this dependency with `mix deps.compile postgrex` or update it with `mix deps.update postgrex`
The suggestions failed. I consulted with #elixir-lang on IRC, this is what worked for me:
Use these dependencies instead of the ones specified in the tutorial (in mix.exs):
{:postgrex, ">= 0.0.0"},
{:ecto, "~> 0.2.0"}
then . . .
$ mix deps.unlock --all
$ mix deps.clean --all
$ mix deps.get
$ mix compile
That fixed it for me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment