I have installed new elixir 1.7.4 and OTP 20.2.4. When I run iex I get error:
2018-11-09 17:47:11 Loading of ~ts failed: ~p
"/usr/local/Cellar/asdf/0.5.1/installs/elixir/1.7.4/bin/../lib/iex/ebin/Elixir.IEx.CLI.beam"
badfile
2018-11-09 17:47:11 ~s~n
"beam/beam_load.c(1863): Error loading module 'Elixir.IEx.CLI':\n This BEAM file was compiled for a later version of the run-time system than 20.\n To fix this, please recompile this module with an 20 compiler.\n (Use of opcode 162; this emulator supports only up to 159.)\n"
2018-11-09 17:47:11 crash_report
initial_call: {supervisor_bridge,user_sup,['Argument__1']}
pid: <0.50.0>
registered_name: []
error_info: {error,undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ancestors: [kernel_sup,<0.36.0>]
message_queue_len: 0
messages: []
links: [<0.37.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 610
stack_size: 27
reductions: 224
2018-11-09 17:47:11 supervisor_report
supervisor: {local,kernel_sup}
errorContext: start_error
reason: {undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
offender: [{pid,undefined},{id,user},{mfargs,{user_sup,start,[]}},{restart_type,temporary},{shutdown,2000},{child_type,supervisor}]
2018-11-09 17:47:11 crash_report
initial_call: {application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}
pid: <0.35.0>
registered_name: []
error_info: {exit,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,134}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
ancestors: [<0.34.0>]
message_queue_len: 1
messages: [{'EXIT',<0.36.0>,normal}]
links: [<0.34.0>,<0.33.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 987
stack_size: 27
reductions: 243
2018-11-09 17:47:11 std_info
application: kernel
exited: {{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,365}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}}},{kernel,start,[normal,[]]}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,\"user_sup.erl\"},{line,100}]},{user_sup,init,1,[{file,\"user_sup.erl\"},{line,49}]},{supervisor_bridge,init,1,[{file,\"supervisor_bridge.erl\"},{line,80}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,365}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,333}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,247}]}]}}},{kernel,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,user,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.
Crash dump is being written to: erl_crash.dump...done
There is no suchlike problem with OTP 21.0.9
can you run elixir --version or that crashes too?
Elixir v1.7 handles OTP 19+ and if you asdf install elixir 1.7.4 I believe you'll get a version compiled against lowest version (so OTP 19) or highest, and so if you're currently running say OTP 20 it may crash. Can you try asdf install elixir 1.7.4-otp-20?
It is precisely what @wojtekmach said. You have compiled Elixir with a more recent OTP version (likely OTP 21) and then downgraded the system to OTP 20. You need to either recompile/reinstall Elixir or move back to OTP 21.
Most helpful comment
can you run
elixir --versionor that crashes too?Elixir v1.7 handles OTP 19+ and if you
asdf install elixir 1.7.4I believe you'll get a version compiled against lowest version (so OTP 19) or highest, and so if you're currently running say OTP 20 it may crash. Can you tryasdf install elixir 1.7.4-otp-20?