Couldn't start Elixir.App.Repo when deploying to Heroku

Hi, I’ve been trying to deploy my app to heroku. Once for a while the app will start, but most of the time it crashes with the following error:

2017-09-09T15:15:31.229233+00:00 heroku[web.1]: Starting process with command `mix phoenix.server`
2017-09-09T15:15:34.669870+00:00 app[web.1]: warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
2017-09-09T15:15:34.669882+00:00 app[web.1]:   /app/deps/mailgun/mix.exs:8
2017-09-09T15:15:34.669883+00:00 app[web.1]: 
2017-09-09T15:15:34.991010+00:00 app[web.1]: 15:15:34.990 [error] Loading of /app/_build/prod/lib/poolboy/ebin/poolboy.beam failed: :badfile
2017-09-09T15:15:34.991029+00:00 app[web.1]: 
2017-09-09T15:15:34.991279+00:00 app[web.1]: 15:15:34.990 [error] beam/beam_load.c(1287): Error loading module poolboy:
2017-09-09T15:15:34.991280+00:00 app[web.1]:   mandatory chunk of type 'Atom' not found
2017-09-09T15:15:34.991280+00:00 app[web.1]: 
2017-09-09T15:15:34.991281+00:00 app[web.1]: 
2017-09-09T15:15:34.991281+00:00 app[web.1]: 
2017-09-09T15:15:36.533518+00:00 app[web.1]: {"Kernel pid terminated",application_controller,"{application_start_failure,aion,{{shutdown,{failed_to_start_child,'Elixir.Aion.Repo',{undef,[{poolboy,child_spec,['Elixir.DBConnection.Poolboy',[{name,{local,'Elixir.Aion.Repo.Pool'}},{strategy,fifo},{size,18},{max_overflow,0},{worker_module,'Elixir.DBConnection.Poolboy.Worker'}],{'Elixir.Postgrex.Protocol',[{types,'Elixir.Ecto.Adapters.Postgres.TypeModule'},{name,'Elixir.Aion.Repo.Pool'},{otp_app,aion},{repo,'Elixir.Aion.Repo'},{timeout,15000},{pool_timeout,5000},{adapter,'Elixir.Ecto.Adapters.Postgres'},{pool_size,18},{ssl,true},{username,<<\"dehhpdivwcaiec\">>},{password,<<\"9eae2a52ab979470c9c5bd360a7ce5fde84a845e173d186f9438a57a0d8f0059\">>},{database,<<\"da3iv96tf6ovf8\">>},{hostname,<<\"ec2-54-75-249-162.eu-west-1.compute.amazonaws.com\">>},{port,5432},{pool,'Elixir.DBConnection.Poolboy'}]}],[]},{'Elixir.Ecto.Repo.Supervisor',init,1,[{file,\"lib/ecto/repo/supervisor.ex\"},{line,123}]},{supervisor,init,1,[{file,\"supervisor.erl\"},{line,294}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,328}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,247}]}]}}},{'Elixir.Aion',start,[normal,[]]}}}"}
2017-09-09T15:15:36.533955+00:00 app[web.1]: Kernel pid terminated (application_controller) ({application_start_failure,aion,{{shutdown,{failed_to_start_child,'Elixir.Aion.Repo',{undef,[{poolboy,child_spec,['Elixir.DBConnection.Poolboy',[{name,{
2017-09-09T15:15:36.534244+00:00 app[web.1]: 
2017-09-09T15:15:37.574301+00:00 heroku[web.1]: Process exited with status 1
2017-09-09T15:15:37.467579+00:00 app[web.1]: Crash dump is being written to: erl_crash.dump...done
2017-09-09T15:15:37.585262+00:00 heroku[web.1]: State changed from starting to crashed

I tried cleaning the deps, getting them and compiling manually, but this is what I ended up with:

~ $ mix deps.compile
warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name
  /app/deps/mailgun/mix.exs:8

warning: variable "description" does not exist and is being expanded to "description()", please use parentheses to remove the ambiguity or change the variable name
  /app/deps/simetric/mix.exs:8

warning: variable "package" does not exist and is being expanded to "package()", please use parentheses to remove the ambiguity or change the variable name
  /app/deps/simetric/mix.exs:9

==> gettext
Compiling 0 files (.erl)
Compiling 20 files (.ex)
==> aion
Could not find "rebar3", which is needed to build dependency :ranch
I can install a local copy which is just used by Mix
Shall I install rebar3? (if running non-interactively, use: "mix local.rebar --force") [Yn] 
* creating .mix/rebar
* creating .mix/rebar3
===> Compiling ranch
===> Failed to restore /app/deps/ranch/.rebar3/erlcinfo file. Discarding it.

==> poolboy (compile)
warning: module attribute @shortdoc was set but never used
  /app/deps/comeonin/mix.exs:2

cc -g -O3 -Wall -I/app/.platform_tools/erlang/erts-8.3/include -Ic_src -fPIC -shared  -o priv/bcrypt_nif.so c_src/bcrypt_nif.c c_src/blowfish.c
make: cc: Command not found
Makefile:27: recipe for target 'priv/bcrypt_nif.so' failed
make: *** [priv/bcrypt_nif.so] Error 127
==> comeonin
could not compile dependency :comeonin, "mix compile" failed. You can recompile this dependency with "mix deps.compile comeonin", update it with "mix deps.update comeonin" or clean it with "mix deps.clean comeonin"
==> aion
** (Mix) Could not compile Comeonin.

Please make sure that you are using Erlang / OTP version 18.0 or later
and that you have a C compiler installed.

Please follow the directions below for the operating system you are
using:

Mac OS X: You need to have gcc and make installed. Try running the
commands `gcc --version` and / or `make --version`. If these programs
are not installed, you will be prompted to install them.

Linux: You need to have gcc and make installed. If you are using
Ubuntu or any other Debian-based system, install the packages
`build-essential`. Also install `erlang-dev` package if not
included in your Erlang/OTP version.

See https://github.com/riverrun/comeonin/wiki/Requirements for more
information.

If you have any ideas on how I could fix this, I’d be really glad to hear them. Thanks!