distilleryを利用したリリースビルドから、command経由でmoduleを実行する際のハマりどころ
2点ハマりどころがあったのでまとめておく。
リリースビルドに含まれないmoduleを実行していないか
/path/to/bin$ ./some command Elixir.Some.Module run ...
{"init terminating in do_boot",{undef,[{'Elixir.Some.Module',application,[],[]},...,{line,24}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}} init terminating in do_boot ()
/path/to/lib/some
配下で、 Elixir.Some.Module.beam
ファイルが生成されているかどうか確認する。
ETSの上限に達していないか
/path/to/bin$ ./some command Elixir.Some.Module run ...
{"init terminating in do_boot",{{badmatch,{error,{some,{{shutdown,{failed_to_start_child,'XXXX',{shutdown,{failed_to_start_child,'XXXX',{system_limit,[{ets,new,['XXXXXX',[set,public,named_table,{read_concurrency,true}]],[]},...{init,start_em,1,[]},{init,do_boot,3,[]}]}} init terminating in do_boot ()
ETSの上限に達している場合、上記のようなエラーが出る。ETSの上限は ERL_OPTS
から "+e 16384"
のように渡すことが出来る。
distilleryのビルドの設定で、 erl_opts
から設定を追加する。