Trouble setting up phoenix

Hello,

elixir/phoenix noob here. :slight_smile:

First of all:

Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.4.1

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.

1 Like

Have you generated your application the way that it’s called “Elixir”? :smiley:

I think that’s one thing you can’t do.

2 Likes

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.

1 Like

Hm…ty guys. Actually I didn’t provide any name, but yes, the folder i m creating the project in is called elixir. That’s a bit odd.

1 Like

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.

1 Like

Thanks!

1 Like