# Create your new project
mix new your_project
cd your_project
# Add '{:sugar, github: "sugar-framework/sugar"}'
# to your deps
vi mix.exs
# Get dependencies and compile them
mix do deps.get, deps.compile
Output:
Generated plug.app
==> plugs
Compiled lib/sugar/plugs/parsers/json.ex
Compiled lib/sugar/plugs/hot_code_reload.ex
Compiled lib/sugar/plugs/exceptions.ex
lib/sugar/plugs/logger.ex:1: warning: behaviour Plug.Wrapper undefined
Compiled lib/sugar/plugs/logger.ex
Generated plugs.app
==> postgrex
warning: the dependency postgrex requires Elixir "~> 0.15.0" but you are running on v1.0.0
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
(elixir) src/elixir.erl:175: :elixir.erl_eval/3
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`
Adding { :postgrex, "~> 0.6.0" } to the mix.exs deps section gets a clean get/compile cycle. To run mix sugar.init however, it required me to also update deps/sugar/mix.exs with the upgraded postgrex version.
I have no idea if this workaround can be plugged straight in as I've only recently started learning Elixir and know next to nothing :) mix server did successfully start and I could get a "hello world" from the server, so it's working so far.
Working through the Getting Started tl;dr steps:
Output:
Adding
{ :postgrex, "~> 0.6.0" }
to themix.exs
deps section gets a clean get/compile cycle. To runmix sugar.init
however, it required me to also updatedeps/sugar/mix.exs
with the upgraded postgrex version.I have no idea if this workaround can be plugged straight in as I've only recently started learning Elixir and know next to nothing :)
mix server
did successfully start and I could get a "hello world" from the server, so it's working so far.