Я пытаюсь создать выпуск для моего проекта феникс-рамки.Производство env не находит OTP-модуль: httpc при использовании exrm
Все работает нормально, пока мой код не должен выполнять определенное действие, используя: httpc-модуль от OTP.
По-видимому, exrm не связал модуль httpc и, следовательно, не смог его найти.
Я пытался добавить его в мой mix.exs приложений пристройки, но как только я, он откажется создать релиз из-за «ошибки»
ли кто-нибудь знает, как это исправить?
Для mix.env с: httpc как зависимость:
$ MIX_ENV=prod mix release --verbosity=vebose
Building release with MIX_ENV=prod.
==> Generating relx configuration...
==> Generating sys.config...
==> Generating boot script...
==> Packaging consolidated protocols...
==> Generating release...
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
/home/morgan/Documents/rateapi/_build/prod/lib
/home/morgan/Documents/rateapi/deps
/usr/local/lib/elixir/bin/../lib/eex/ebin
/usr/local/lib/elixir/bin/../lib/elixir/ebin
/usr/local/lib/elixir/bin/../lib/ex_unit/ebin
/usr/local/lib/elixir/bin/../lib/iex/ebin
/usr/local/lib/elixir/bin/../lib/logger/ebin
/usr/local/lib/elixir/bin/../lib/mix/ebin
/home/morgan/Documents/rateapi/lib
/usr/erlang/otp_R18B03/lib/erlang/lib
/home/morgan/Documents/rateapi/rel
==> ERROR: "Failed to build release. Please fix any errors and try again."
Для mix.env без: httpc зависимость:
** (exit) an exception was raised:
** (UndefinedFunctionError) function :httpc.request/4 is undefined (module :httpc is not available)
:httpc.request(:get, {'http://free.currencyconverterapi.com/api/v3/currencies', []}, [], [])
(fx_rates) web/controllers/rate_controller.ex:46: FxRates.V1.RateController.reload_currencies/0
(fx_rates) web/controllers/rate_controller.ex:66: FxRates.V1.RateController.show/2
(fx_rates) web/controllers/rate_controller.ex:1: FxRates.V1.RateController.action/2
(fx_rates) web/controllers/rate_controller.ex:1: FxRates.V1.RateController.phoenix_controller_pipeline/2
(fx_rates) lib/phoenix/router.ex:261: FxRates.Router.dispatch/2
(fx_rates) web/router.ex:1: FxRates.Router.do_call/2
(fx_rates) lib/fx_rates/endpoint.ex:1: FxRates.Endpoint.phoenix_pipeline/1
Это может произойти, если приложение 'inets' не было добавлено в релиз. Вы можете просмотреть файл 'script' в выпуске, чтобы узнать, какие приложения запускаются с выпуском. – Amiramix