I get an error when using mix ecto.create for my first Elixir project

107 views Asked by At

When I do mix ecto.create I get following error:

could not compile dependency :mint, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile mint --force", update it with "mix deps.update mint" or clean it with "mix deps.clean mint"

The mentioned logs are: ==> mint

Compiling 1 file (.erl)
src/mint_shims.erl:37:14: can't find include lib "public_key/include/public_key.hrl"
%   37| -include_lib("public_key/include/public_key.hrl").
%     |              ^

src/mint_shims.erl:64:21: undefined macro 'id-ce-subjectAltName'
%   64|         try lists:keyfind(?'id-ce-subjectAltName',
%     |                            ^

src/mint_shims.erl:39:2: function pkix_verify_hostname/3 undefined
%   39| -export([pkix_verify_hostname/2, pkix_verify_hostname/3]).
%     |  ^

src/mint_shims.erl:42:36: record 'OTPCertificate' undefined
%   42| -spec pkix_verify_hostname(Cert :: #'OTPCertificate'{} | binary(),
%     |                                    ^

src/mint_shims.erl:45:2: spec for undefined function pkix_verify_hostname/3
%   45| -spec pkix_verify_hostname(Cert :: #'OTPCertificate'{} | binary(),
%     |  ^

src/mint_shims.erl:45:36: record 'OTPCertificate' undefined
%   45| -spec pkix_verify_hostname(Cert :: #'OTPCertificate'{} | binary(),
%     |                                    ^

src/mint_shims.erl:52:5: function pkix_verify_hostname/3 undefined
%   52|     pkix_verify_hostname(Cert, ReferenceIDs, []).
%     |     ^

src/mint_shims.erl:114:1: Warning: function verify_hostname_extract_fqdn_default/1 is unused
%  114| verify_hostname_extract_fqdn_default({dns_id,S}) ->
%     | ^

src/mint_shims.erl:122:1: Warning: function verify_hostname_fqnds/2 is unused
%  122| verify_hostname_fqnds(L, FqdnFun) ->
%     | ^

src/mint_shims.erl:139:1: Warning: function verify_hostname_match_default/2 is unused
%  139| verify_hostname_match_default(Ref, Pres) ->
%     | ^

src/mint_shims.erl:142:1: Warning: function verify_hostname_match_default0/2 is unused
%  142| verify_hostname_match_default0(FQDN=[_|_], {cn,FQDN}) ->
%     | ^

src/mint_shims.erl:182:1: Warning: function ok/1 is unused
%  182| ok({ok,X}) -> X.
%     | ^

src/mint_shims.erl:184:1: Warning: function l16_to_tup/1 is unused
%  184| l16_to_tup(L) -> list_to_tuple(l16_to_tup(L, [])).
%     | ^

src/mint_shims.erl:186:1: Warning: function l16_to_tup/2 is unused
%  186| l16_to_tup([A,B|T], Acc) -> l16_to_tup(T, [(A bsl 8) bor B | Acc]);
%     | ^

src/mint_shims.erl:189:1: Warning: function match_wild/2 is unused
%  189| match_wild(A,     [$*|B]) -> match_wild_suffixes(A, B);
%     | ^

src/mint_shims.erl:195:1: Warning: function match_wild_suffixes/2 is unused
%  195| match_wild_suffixes(A, B) -> match_wild_sfx(lists:reverse(A), lists:reverse(B)).
%     | ^

src/mint_shims.erl:197:1: Warning: function match_wild_sfx/2 is unused
%  197| match_wild_sfx([$*|_],      _) -> false; % Bad name (no wildcards allowed)
%     | ^

src/mint_shims.erl:204:1: Warning: function verify_hostname_match_loop/5 is unused
%  204| verify_hostname_match_loop(Refs0, Pres0, undefined, FailCB, Cert) ->
%     | ^

src/mint_shims.erl:227:1: Warning: function to_lower_ascii/1 is unused
%  227| to_lower_ascii({ip,_}=X) -> X;
%     | ^

src/mint_shims.erl:234:1: Warning: function to_string/1 is unused
%  234| to_string(S) when is_list(S) -> S;
%     | ^

I tried reinstalling everything! Maybe there is something wrong with postgresql?

1

There are 1 answers

0
Luis Serrano On

When you create a new Phoenix project with mix phx.new test you just need to run the commands that are displayed in your terminal from that directory. You should see and follow this in your terminal:

We are almost there! The following steps are missing: Fetch and install dependencies? [Yn]

(I usually directly enter 'Y' here instead of mix deps.get the first time)

$ cd test
$ mix deps.get

Then configure your database in config/dev.exs and run:

$ mix ecto.create

Start your Phoenix app with:

$ mix phx.server

You can also run your app inside IEx (Interactive Elixir) as:

$ iex -S mix phx.server

If it doesn't work, reinstall Phoenix.

I hope it helps!