4

I´am working my way through ´Programming Elixir´ by Dave Thomas. I now hit the point where you create your first mix project. HTTPoison was just introduced and added to the application function in the mix.exs. Now the project should be compiled the first time using iex -S mix. At that point I had problems with ssl_verify_hostname. After installing erlang-src and erlang-dev I am now stuck with following console output

$ iex -S mix
Erlang/OTP 18 [erts-7.1] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]

WARN:  Expected /home/..../issues/deps/idna to be an app dir (containing ebin/*.app), but no .app found.
WARN:  Expected /home/..../issues/deps/ssl_verify_hostname to be an app dir (containing ebin/*.app), but no .app found.
==> hackney (compile)
WARN:  Expected /home/..../issues/deps/idna to be an app dir (containing ebin/*.app), but no .app found.
WARN:  Expected /home/..../issues/deps/ssl_verify_hostname to be an app dir (containing ebin/*.app), but no .app found.
Dependency not available: idna-.* ({git,
                                       "https://github.com/benoitc/erlang-idna",
                                       {tag,"1.0.2"}})
Dependency not available: ssl_verify_hostname-.* ({git,
                                                   "https://github.com/deadtrickster/ssl_verify_hostname.erl",
                                                   {tag,"1.0.5"}})
** (ArgumentError) argument error
    (stdlib) :io.put_chars(#PID<0.26.0>, :unicode, <<69, 82, 82, 79, 82, 58, 32, 99, 111, 109, 112, 105, 108, 101, 32, 102, 97, 105, 108, 101, 100, 32, 119, 104, 105, 108, 101, 32, 112, 114, 111, 99, 101, 115, 115, 105, 110, 103, 32, 47, 104, 111, 109, 101, 47, 114, 107, 114, 97, 117, ...>>)
    (mix) lib/mix/shell.ex:78: Mix.Shell.do_cmd/2
    (mix) lib/mix/tasks/deps.compile.ex:161: anonymous fn/5 in Mix.Tasks.Deps.Compile.do_command/4
    (mix) lib/mix/project.ex:196: Mix.Project.in_project/4
    (elixir) lib/file.ex:1061: File.cd!/2
    (mix) lib/mix/dep.ex:137: Mix.Dep.in_dependency/3
    (mix) lib/mix/tasks/deps.compile.ex:160: Mix.Tasks.Deps.Compile.do_command/4
    (mix) lib/mix/tasks/deps.compile.ex:59: anonymous fn/3 in Mix.Tasks.Deps.Compile.compile/1

Although I´ve searched for different parts of this output I cannot find any helpful information.

Robert Krauß
  • 65
  • 1
  • 8
  • 1
    Which Elixir version are you using? Can you upload the project to Github so we take a look? Something really weird is going on. – José Valim Sep 25 '15 at 20:50
  • 2
    Actually. I am afraid you are having a `rebar` issue (rebar is an Erlang build tool). Make sure you uninstall whatever `rebar` you have available (check with `which rebar`) and then try again. – José Valim Sep 25 '15 at 20:51
  • @JoséValim: Elixir version is 1.0.5. I´ve pushed the project [here](https://github.com/bloodyroot/elixirbook_issues). `rebar` is not installed. Could that be the problem? – Robert Krauß Sep 25 '15 at 21:57
  • 2
    The linux distributions that break erlang up into many small parts really make it hard to use both erlang and elixir. I highly recommend installing erlang directly from erlang.org. – Fred the Magic Wonder Dog Sep 25 '15 at 23:07
  • 1
    I just want to confirm that everything worked fine locally, so it is very likely something with your Erlang installation indeed. As Fred said, I would try installing Erlang from erlang.org or from Erlang Solutions. More info in our docs: http://elixir-lang.org/install.html#installing-erlang – José Valim Sep 26 '15 at 09:51
  • I´ve tried the precompiled Erlang version from erlang-solutions.com and also compiled the source from erlang.org. Before I´ve checked via `dpkg -l` that all erlang packages were removed. Unfortunately the error remains. Only the WARN lines were gone using the precompiled esl-erlang. – Robert Krauß Sep 27 '15 at 00:36

1 Answers1

0

You must install all dependencies before it runs the code.

mix deps.get (It does download of the dependencies)

mix deps (It installs dependencies)

Tiago Davi
  • 21
  • 7
  • 1
    Unfortunately this does not work for me. As a matter of fact it really seems to be a `rebar` issue just as Jose Valim suggested. But I could not figure out how to get rid of it till now. In the meantime I am running a VirtualBox image where I can use mix. – Robert Krauß Oct 06 '15 at 18:39