So, I try to setup a phoenix project, but I get the following error when I execute > mix phoenix.server
== Compilation error on file lib/elixir.ex ==
** (CompileError) lib/elixir.ex:1: module Elixir is reserved and cannot be defined
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
(elixir) lib/kernel/parallel_compiler.ex:117: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1
Any ideas ?
Btw, I installed elixir via archlinux package manager, so nothing fancy/hacky.
The error output supports what hubertlepicki said.
because you named the application elixir a module with that name was created. When you tried to start the app the consequence of that is shown in the log.
Well. It’s how Mix generates projects. When you run
mix new elixir
It will not only generate project inside “elixir” directory, but also figure out OTP application name and main module name from the directory name you specify. So, in your case it tries to create top level module called “Elixir”, that is already used and this results in conflict. If you insist on having your stuff in “elixir” directory, use --module MyModule command-line option to overrule default behavior.