Mix test error in Elixir 1.4: "could not find application file"

If you just specify in your mix.exs:

  defp deps do
    [{:exvcr, "~> 0.8"}]
  end

then in Elixir v1.4 this dependency will be automatically added to your application list (in Elixir v1.3 you had to do that explicitly). And so I believe the problem is that exvcr lists http_server as a dev/test dependency but also adds it to application list and so when mix fetches the dependency, it won’t grab http_server but since it’s in the application list Elixir will attempt to start it and fail.

Now, looking at exvcr docs, they don’t instruct to add exvcr to your application list. I think http_server is just being used for the development of exvcr and not supposed to be used projects using it.

In Elixir v1.4 you can specify that your dependency shouldn’t be added to your application list by doing:

  defp deps do
    [{:exvcr, "~> 0.8", runtime: false}]
  end

and it should fix it.

7 Likes