我有一个路由器插头
defmodule Rest do
use Plug.Router
import Plug.Conn
plug :match
plug :dispatch
get "/hello" do
send_resp(conn, 200, "Hello, world!")
end
match _ do
send_resp(conn, 404, "oops")
end
def start do
Plug.Adapters.Cowboy.http Rest, [], port: 80
end
def stop do
Plug.Adapters.Cowboy.shutdown Rest.HTTP
end
end
Run Code Online (Sandbox Code Playgroud)
但是,当我调用Rest.start时
{:error,
{{:shutdown,
{:failed_to_start_child, :ranch_acceptors_sup,
{{:badmatch, {:error, :eacces}},
[{:ranch_acceptors_sup, :init, 1,
[file: 'src/ranch_acceptors_sup.erl', line: 30]},
{:supervisor, :init, 1, [file: 'supervisor.erl', line: 243]},
{:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 306]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 239]}]}}},
{:child, …Run Code Online (Sandbox Code Playgroud)