Mix is a build tool that provides tasks for creating, compiling, testing Elixir projects, as well as handle dependencies, and more.
Questions tagged [elixir-mix]
339 questions
3
votes
1 answer
:build_embedded and :start_permanent in Elixir
I'm going over the official Elixir website and learning about Mix at the moment. I'm following their example.
In the document, they mention:
When you compile your source code, Elixir compiles artifacts to the
_build directory. However, in many…

user7418039
- 301
- 3
- 10
3
votes
1 answer
iex- How to run an elixir project from outside the app folder
I have some situation,
in which i need to run an elixir project, from outside the project file.
i.e. i have a folder code/example-app that contains the app (with the mix.exs and all the rest)
and i would like to run that app from code,
without…

fay
- 2,086
- 2
- 14
- 36
3
votes
1 answer
Debug level logging for `mix ecto.rollback` and `mix ecto.migrate` commands
Currently, I'm looking for the way to add SQL-statements logging while running mix tasks. For example, commands such mix ecto.rollback and mix ecto.migrate outputs informative:
...
13:45:53.016 [info] == Running…

sashaegorov
- 1,821
- 20
- 26
3
votes
1 answer
What is equivalent to npm install --save in elixir mix with hex
Is there an equivalent to npm install --save for quick adding hex module to mix.exs ?
I know pasting hex module references do mix.exs deps function like this:
defp deps do
[
{:asn, "~> 0.2.1"},
{:mix_docker, "~> 0.3.0"}
]
…

Luman75
- 878
- 1
- 11
- 28
3
votes
1 answer
Configure applications to be loaded only in test environment
How can I configure applications to be loaded in run time only in a certain environment?
I know I can configure a dependency only for test environment.
Is there a way to configure applications in mix.exs to be loaded only in test environment?
For…

fay
- 2,086
- 2
- 14
- 36
3
votes
1 answer
Mix hangs on deps.compile while compiling riak_core project
I am trying to compile https://github.com/kanatohodets/elixir_riak_core_ping. I have erlang 18 installed and elixir version is 1.3.
compilation hangs at below line and does not move ahead:
Downloaded package, caching at…

naveen
- 1,016
- 1
- 9
- 22
3
votes
2 answers
Unable to mix ecto.create. Multiple errors
When trying to run mix ecto.create I got the following errors:
.Repo couldn't be created: tcp connect: connection refused - :econnrefused
.Repo couldn't be created: FATAL (invalid_authorization_specification): role "postgres" does not exist
.Repo…

Jonathan Soifer
- 2,715
- 6
- 27
- 50
3
votes
1 answer
How to reinstall Elixir properly?
I use brew remove elixir --force and brew install elixir.
elixir -v shows
Erlang/OTP 19 [erts-8.0.2] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Elixir 1.3.2
Then I use mix local.hex. mix hex.info shows…

user4323437
- 41
- 4
3
votes
2 answers
How to launch multiple applications from mix.exs?
I have an Elixir app with two applications inside the lib/ folder:
myproject/lib/app1
myproject/lib/app2
They both have files which use Application:
myproject/lib/app1.exs
myproject/lib/app2.exs
They each implement start and spawn a supervision…

sheldonkreger
- 858
- 1
- 9
- 25
3
votes
0 answers
Bad encoding error in mix.exs
I am receiving this error message when I run mix test in my application:
** (Mix) Could not start application brcpfcnpj: 'bad encoding'
I understand that the error happens because I inserted some accented characters, but I was expecting this to…

alfakini
- 4,635
- 2
- 26
- 35
3
votes
1 answer
Configuration file for MIX app as OTP app
I have an OTP Application (ChicagBoss actually). I'm trying to incorporate Phoenix app into it (as just casual OTP app).
I think that most of applications start, but I got error caused by lack of config file. How to provide configuration file to…

Saczew
- 323
- 2
- 8
3
votes
0 answers
Could not compile dependency :idna after adding "timex" dependency.
After adding "timex" dependency I am facing this issue here is the error
===> Command bare not found
** (Mix) Could not compile dependency :idna, "/usr/bin/rebar3 bare compile --paths "phoenix/_build/dev/lib/*/ebin"" command failed.…

KJ_kaka
- 241
- 3
- 10
3
votes
1 answer
How to build erlang dependency with rebar and make at once in Elixir project
I wrote a erlport wrapper for elixir, but have a problem to compile erlport as a dependency. You can find it here: https://github.com/fazibear/export
Export mix.exs file:
defp deps do
[
{:erlport, git: "https://github.com/hdima/erlport.git",…

fazibear
- 137
- 8
3
votes
1 answer
Loading an Erlang project in a Elixir app
I'm building an Elixir application that uses the hackney Erlang project and I'm unable to use the methods provided by hackney.
My mix.exs looks like this:
defmodule Connecter.Mixfile do
use Mix.Project
def project do
[app: :connecter,
…

user3790827
- 695
- 1
- 8
- 17
3
votes
1 answer
mix does not work behind proxy
I always have been using mix behind proxy at least just 2 weeks ago.
However I found that mix becomes not to be able to work behind proxy yesterday.
mix version is 1.1.1.
mix local.hex runs.
But mix deps.get occurs errors.
$ mix deps.get
Registry…

HirofumiTamori
- 1,125
- 2
- 13
- 27