我在我的第一个 Elixir 项目中使用 mix ecto.create 时遇到错误

问题描述 投票:0回答:1

当我混合 ecto.create 时,出现以下错误:

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"

提到的日志是:==>薄荷

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;
%     | ^

我尝试重新安装一切!也许postgresql有问题?

elixir phoenix-framework
1个回答
0
投票

当您使用

mix phx.new test
创建新的 Phoenix 项目时,您只需从该目录运行终端中显示的命令。您应该在终端中看到并遵循此操作:

我们快到了!缺少以下步骤: 获取并安装依赖项? [嗯]

(我第一次直接输入“Y”而不是

mix deps.get

$ cd test
$ mix deps.get

然后在 config/dev.exs 中配置数据库并运行:

$ mix ecto.create

启动您的 Phoenix 应用程序:

$ mix phx.server

您还可以在 IEx(Interactive Elixir)中运行您的应用程序,如下所示:

$ iex -S mix phx.server

如果还不行,请重新安装Phoenix。

希望对你有帮助!

© www.soinside.com 2019 - 2024. All rights reserved.