首页 > 解决方案 > 十六进制安装在 aws 实例上失败,无法获取元数据

问题描述

这是在一个 aws lightsail 实例上,试图部署我的 phoenix 应用程序,混合 local.hex 失败,知道如何解决这个问题吗?

可能是 DNS 问题,但不确定。

Could not install Hex because Mix could not download metadata at https://repo.hex.pm/instal
ls/hex-1.x.csv.
 mix local.hex --force

14:34:53.444 [error] Unable to load crypto library. Failed with error:
":load_failed, Failed to load NIF library: '/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: ver
sion `OPENSSL_1_1_1' not found (required by /usr/lib/erlang/lib/crypto-4.7/priv/lib/crypto.
so)'"
OpenSSL might not be installed on this system.


14:34:53.455 [warn]  The on_load function for module crypto returned:
{:error, {:load_failed, 'Failed to load NIF library: \'/usr/lib/x86_64-linux-gnu/libcrypto.
so.1.1: version `OPENSSL_1_1_1\' not found (required by /usr/lib/erlang/lib/crypto-4.7/priv
/lib/crypto.so)\''}}

** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}},
 {:inet, [:inet], {:eoptions, {:undef, [{:crypto, :supports, [], []}, {:tls_record, :suffic
ient_support, 1, [file: 'tls_record.erl', line: 743]}, {:tls_record, :supported_protocol_ve
rsions, 1, [file: 'tls_record.erl', line: 370]}, {:tls_record, :supported_protocol_versions
, 0, [file: 'tls_record.erl', line: 358]}, {:ssl, :handle_option, 4, [file: 'ssl.erl', line
: 1903]}, {:ssl, :process_options, 3, [file: 'ssl.erl', line: 1635]}, {:ssl, :handle_option
s, 3, [file: 'ssl.erl', line: 1589]}, {:ssl, :connect, 4, [file: 'ssl.erl', line: 593]}]}}}
]}

Could not install Hex because Mix could not download metadata at https://repo.hex.pm/instal
ls/hex-1.x.csv.

标签: amazon-web-serviceshexelixirphoenix-frameworkelixir-mix

解决方案


阅读完整的错误,我认为问题在于 lightsail 实例上没有安装 OpenSSL。您必须先安装 openssl。你如何做到这一点取决于操作系统。例如,在 linux 上,可以这样做:

sudo apt install openssl

推荐阅读