elixir-maru / maru

Elixir RESTful Framework
https://maru.readme.io
BSD 3-Clause "New" or "Revised" License
1.32k stars 85 forks source link

"invalid tuple specification given to supervise/2" #111

Closed moxley closed 6 years ago

moxley commented 6 years ago

Following https://maru.readme.io/docs/basic-usage, after applying fix suggested in #110:

$ iex -S mix
<skipping many lines>
** (Mix) Could not start application maru: Maru.start(:normal, []) returned an error: an exception was raised:
    ** (ArgumentError) invalid tuple specification given to supervise/2. If you are trying to use the map child specification that is part of the Elixir v1.5, use Supervisor.init/2 instead of Supervisor.Spec.supervise/2. See the Supervisor module for more information. Got: %{id: {:ranch_listener_sup, MyAPP.API.HTTP}, modules: [:ranch_listener_sup], restart: :permanent, shutdown: :infinity, start: {:ranch_listener_sup, :start_link, [MyAPP.API.HTTP, 100, :ranch_tcp, [num_acceptors: 100, max_connections: 16384, port: 8880, ip: {127, 0, 0, 1}], :cowboy_clear, %{env: %{dispatch: [{:_, [], [{:_, [], Plug.Adapters.Cowboy2.Handler, {MyAPP.API, []}}]}]}, stream_handlers: [Plug.Adapters.Cowboy2.Stream]}]}, type: :supervisor}
        (elixir) lib/supervisor/spec.ex:186: Supervisor.Spec.get_id/1
        (elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
        (elixir) lib/supervisor/spec.ex:177: Supervisor.Spec.supervise/2
        (stdlib) supervisor.erl:295: :supervisor.init/1
        (stdlib) gen_server.erl:374: :gen_server.init_it/2
        (stdlib) gen_server.erl:342: :gen_server.init_it/6
        (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Elixir: Elixir 1.6.5 (compiled with OTP 21)

I resolved this by downgrading maru to version 0.10.0. This also required downgrading cowboy to 1.0.4.

falood commented 6 years ago

Hi @moxley , I updated the code but haven't update the documents. There's a new way to start maru server, you can follow the README.md in the repo to do that.

I'm updating the documents in maru.readme.io. I guess #110 and #111 are the same issue, let's discuss it here and I'll close another one.

moxley commented 6 years ago

Yep, it was just a documentation issue. Closing. Thanks @falood!