我正在使用Phoenix Framework运行以下内容以连接到https://api.twitch.tv/kraken/videos/top。它过去曾奏效,并不确定导致此案发生的原因。停止并重新启动iex似乎没有解决它。运行Elixir 1.0.5,Phoenix 0.14.0,Erlang OTP 18
iex(2)> "https://api.twitch.tv/kraken/videos/top" |>
...(2)> HTTPoison.get!()
** (exit) exited in: :gen_server.call(:hackney_manager, {:new_request, #PID<0.334.0>, #Reference<0.0.2.365>, {:client, :undefined, :hackney_dummy_metrics, :hackney_ssl_transport, 'api.twitch.tv', 443, "api.twitch.tv", [connect_timeout: 5000, recv_timeout: :infinity], nil, nil, nil, true, :hackney_pool, :infinity, false, 5, false, 0, nil, nil, nil, :undefined, :start, nil, :normal, false, false, false, nil, :waiting, nil, 4096, "", [], :undefined, nil, nil, nil, nil, :undefined, nil}}, :infinity)
** (EXIT) no process
(stdlib) gen_server.erl:212: :gen_server.call/3
src/hackney_client/hackney_manager.erl:65: :hackney_manager.init_request/1
src/hackney_client/hackney_manager.erl:55: :hackney_manager.new_request/1
src/hackney_connect/hackney_connect.erl:181: :hackney_connect.socket_from_pool/4
src/hackney_connect/hackney_connect.erl:41: :hackney_connect.connect/5
src/hackney_client/hackney.erl:317: :hackney.request/5
lib/httpoison.ex:60: HTTPoison.request/5
lib/httpoison.ex:60: HTTPoison.request!/5
答案 0 :(得分:11)
您确定在:httpoison
的应用列表中添加了mix.exs
吗?我遇到了同样的问题,因为这个原因,我一直在墙上撞了几个小时:
def application do
[mod: {MyAwesomeApp, []},
applications: [:phoenix, :phoenix_html, :cowboy, :logger,
:phoenix_ecto, :postgrex, :httpoison]]
end