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
67
votes
3 answers
How do I recompile an Elixir project and reload it from within iex?
I'm currently learning Elixir by going through the OTP and mix tutorial on the elixir-lang website, and I'm having trouble finding out how to recompile and reload the project from within the shell.
In Erlang I would do make:all([load]) and it would…

KallDrexx
- 27,229
- 33
- 143
- 254
45
votes
2 answers
How can I make Elixir mix test output more verbose?
In my Elixir/Phoenix app, when I run
mix test
I get output like:
$ mix test
....
Finished in 0.09 seconds
4 tests, 0 failures
with dots for each test that succeeded.
How do I output the names of the tests that succeed instead?
In Rails with…

joseph.hainline
- 24,829
- 18
- 53
- 70
35
votes
2 answers
GitHub Actions Invalid Workflow File Error
I started using GitHub Actions and I was able to setup a CI pipeline for Elixir, the action builds and tests without any issues. I also wanted to deploy the application using the heroku actions so I went ahead and added the one that is available in…

Frankely Diaz
- 886
- 1
- 9
- 16
33
votes
1 answer
Installing dependencies in Elixir
Is there a way to install a dependency for an Elixir project directly through the command line using mix or mix hex?
I am aware of the option for searching the hex registry via
$ mix hex.search httpoison
Package Version URL
httpoison 0.11.0 …

Daniel Corin
- 1,987
- 2
- 15
- 27
29
votes
5 answers
Make elixir app recompile and reload on source code change
How to automatically recompile and reload my iex + mix application every time I modify the source code?
If there's no way for iex + mix combination to do that, what's the easiest alternative? I've checked phoenix's way to do reload, and it doesn't…

ardhitama
- 1,949
- 2
- 18
- 29
27
votes
2 answers
Package management on Erlang and Elixir
I searched for package management on Erlang and Elixir and got some pointers to rebar rebar3 mix hex and relx etc. Can you help clarify the relationships among them? Where to use what? Is package just synonym to Erlang's application made up of…

sof
- 9,113
- 16
- 57
- 83
18
votes
3 answers
mix deps.get failed (seems missing ssl?)
I'm sorry but I'm new to Elixir. while building phoenix application, mix deps.get failed with an error.
% mix deps.get
Could not find Hex, which is needed to build dependency :phoenix
Shall I install Hex? [Yn] y
** (MatchError) no match of right…

otiai10
- 4,289
- 5
- 38
- 50
16
votes
4 answers
In elixir, How do i install packages globally?
Can I use mix to install some packages globally? I'd like a behaviour like npm's global option or gem's install - it could be useful for packages I use everywhere like csv or yaml.

Yingce
- 255
- 2
- 9
15
votes
2 answers
Importing test code in elixir unit test
I'm writing tests of some Elixir code that interacts with SSH. In my tests, I'd like to start an SSH server that I can run my code against. I'd prefer to store this code in it's own file in the test directory, and have it imported by various…

obmarg
- 9,369
- 36
- 59
14
votes
2 answers
Elixir mix auto acknowledge
I want to run tests of my Phoenix app on Travis-CI.
Log excerpt:
$ MIX_ENV=test mix do deps.get, compile, test
Could not find hex, which is needed to build dependency :phoenix
Shall I install hex? [Yn]
When it comes to fetching and installing…

nein.
- 2,037
- 2
- 15
- 17
13
votes
1 answer
What does `runtime: false` mean in the Mixfile dependencies?
From the mix deps documentation:
:runtime - whether the dependency is part of runtime applications.
If the :applications key is not provided in def application in
your mix.exs file, Mix will automatically included all dependencies as
a…

toraritte
- 6,300
- 3
- 46
- 67
13
votes
1 answer
Why does MIX dependencies have a "~>" before the semantic version of the dependency?
On mix.exs you can declare dependencies like:
def deps do
[{:plug, "~> 1.0"}]
end
Why does it need to have "~>" instead of simply the version on the second part of the tuple.
I have seen that if it gets the dependency from git, you can write the…

Camilo Sampedro
- 1,306
- 1
- 19
- 32
13
votes
1 answer
Elixir ExUnit: module under test is not available
I'm following this tutorial: http://elixir-lang.org/getting-started/mix-otp/agent.html
So in my Elixir project I have a module lib/kv/bucket.exs, and a test for it test/kv/bucket_test.exs.
When I'm running mix test, I get the following error: **…

Yos Riady
- 880
- 2
- 11
- 18
12
votes
4 answers
How to get data from Ecto in a custom mix task
I want to display data from my DB through Ecto in a custom mix task. How can I get the Ecto repo in my task (or start it)?
I tried something like this but it didn't work:
defmodule Mix.Tasks.Users.List do
use Mix.Task
use Mix.Config
use…

Mika Andrianarijaona
- 1,619
- 17
- 29
12
votes
3 answers
MIX_ENV=prod on a Phoenix server crashes on starting with PORT=80
I am having some issues with mix, and MIX_ENV=prod with mix phoenix.server, where it fails on starting. Running all latest (Elixir 1.0.5, Phoenix 0.14.0) except Erlang (17.x, 17.3 I think) on Linode's Ubuntu 14.04.
$ MIX_ENV=prod PORT=80 mix…

rockerBOO
- 2,920
- 2
- 16
- 22