William Bode
William Bode

Reputation: 74

Elixir Compilation Error for Hello World program

when I want to write a simple hello world program with Elixir, it does not compile. I also cannot load it with 'c "hello.exs"'. It always gives me this error:

** (CompileError) hello.exs: internal error in expand_module;
crash reason: undef

  in function  erl_parse:new_anno/1
     called as erl_parse:new_anno({function,0,module_info,0,
           [{clause,0,[],[],
                    [{call,0,
                           {remote,0,{atom,0,erlang},{atom,0,get_module_info}},
                           [{atom,0,elixir_compiler_0}]}]}]})
  in call from sys_pre_expand:'-module_predef_funcs/1-lc$^0/1-0-'/1 (sys_pre_expand.erl, line 119)
  in call from sys_pre_expand:module_predef_funcs/1 (sys_pre_expand.erl, line 119)
  in call from sys_pre_expand:module/2 (sys_pre_expand.erl, line 81)
  in call from compile:expand_module/1 (compile.erl, line 1202)
  in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 295)
  in call from compile:fold_comp/3 (compile.erl, line 321)
  in call from compile:internal_comp/4 (compile.erl, line 305)
    (stdlib) lists.erl:1336: :lists.foreach/2
    (elixir) lib/code.ex:307: Code.require_file/2

I use Linux Mint 17 and installed elixir with the script mentioned here:

http://datamelon.io/blog/2015/elixir-installer-for-linux-mint.html

Doing stuff in IEX does work however.

How do I get my compiler to work?

Thank you in advance!

Upvotes: 3

Views: 286

Answers (2)

William Bode
William Bode

Reputation: 74

Thanks for looking into this. I have now solved it this way: I had version 17.0 of Erlang. So I tried version 17.1 and it still didn't work. But after upgrading to Erlang 18.0 it miraculously worked.

Shoutout to kerl, which made the process quick and painless.

Upvotes: 0

José Valim
José Valim

Reputation: 51429

Linux distributions break Erlang into multiple packages, which is very confusing. You probably need to find an Erlang package called "erlang-parser" or "erlang-parser-tools" or similar and you should be good to go.

Upvotes: 1

Related Questions