Re: iex -S mix doesn't start application

920 views
Skip to first unread message

José Valim

unread,
Feb 15, 2013, 11:11:33 PM2/15/13
to elixir-l...@googlegroups.com

I followed the OTP tutorial here: http://elixir-lang.org/getting_started/mix/2.html

Near the end we add the application registration in mix.exs as well as the start code to the stacker.ex file. Everything works, but not quite the way the tutorial says. The tutorial says that if we restart iex with  "iex -S mix" then it will automatically start the (:stacker) application. I haven't found this to be the case, I've had to manually :application.start(:stacker) . Is it really supposed to start the application as described? My code is exactly what the tutorial lays out,  I even went through it a second time in a clean directory.

Hello Jeremy,

Someone pointed out this bug yesterday and I have addressed it in the master repository.
We plan to release 0.8.1 this weekend to fix it. You can get the expected behaviour by running `iex -S mix run`.

Sorry for the inconvenience and welcome!


José Valim
Skype: jv.ptec
Founder and Lead Developer


 

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

José Valim

unread,
May 8, 2013, 11:54:22 PM5/8/13
to JT Archie, elixir-l...@googlegroups.com, jose....@plataformatec.com.br
I am getting home soon, so I will take a further look at it. In any case, can you put your stacker project on GitHub? It will be easier to figure stuff out. :)

On Wednesday, May 8, 2013, JT Archie wrote:
I also having issues with the tutorial. I am, however, not getting as far as above.

When I get to the point of starting the link to Stacker.Server, I receive the following error.

○ → iex -S mix
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (0.8.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> { :ok, pid } = :gen_server.start_link(Stacker.Server, [], [])
** (MatchError) no match of right hand side value: {:error,{:undef,[{Stacker.Server,:init,[[]],[]},{:gen_server,:init_it,6,[file: 'gen_server.erl', line: 304]},{:proc_lib,:init_p_do_apply,3,[file: 'proc_lib.erl', line: 227]}]}}
    :erl_eval.expr/3

iex(1)>

Has something change with mix that needs to update the tutorial? Or is there something wrong with the gen_server include to the module?

Regards, JT


--

JT Archie

unread,
May 9, 2013, 12:25:08 AM5/9/13
to elixir-l...@googlegroups.com, JT Archie, jose....@plataformatec.com.br
Done.


All done on elixir version 0.8.2.

Alexei Sholik

unread,
May 9, 2013, 3:29:32 AM5/9/13
to elixir-lang-core, JT Archie, jose....@plataformatec.com.br
The error says that the function Stacker.init/1 cannot be found. Or the module itself cannot be found.

When I do the tutorial from scratch and start iex, I get this output:

λ iex -S mix
Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]

Compiled lib/stacker.ex
Compiled lib/stacker/server.ex
Generated stacker.app
Interactive Elixir (0.8.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>

Notice that mix compiles the source files and generates an .app file for your app the first time. Are you sure you're running `iex -S mix` inside your project's directory? You could also run `mix compile` and check that `ebin` directory contains two .beam and one .app file. If the files are there for you, start `iex -S mix` from `ebin/..`.

I get 404 for you github link.
Best regards
Alexei Sholik
Reply all
Reply to author
Forward
0 new messages