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
7
votes
2 answers
Use a local repository in Elixir?
When including external repositories in your Phoenix Framework project, it is possible to pass a Github option:
{:example, "~> 0.9.9", github: "somewhere/example"}
Is there an option to include a local repository, similar to the Rails convention…

Don Pflaster
- 1,000
- 7
- 22
7
votes
2 answers
How to run Elixir Supervisor in escript
I have a mix project with as simple as possible a Supervisor and GenServer. When I call from iex:
EchoCmd.Supervisor.start_link([:Hello])
GenServer.call(:echoserver, :echo)
GenServer.call(:echoserver, :mumble)
GenServer.call(:echoserver,…

10 cls
- 1,325
- 2
- 17
- 31
7
votes
2 answers
How do Elixir with Mix make a daemon?
Elixir & Mix all want to make the server as a daemon.
There have not been able to find the right way.
In addition, I want to use the erlang reltool.

aposto
- 566
- 5
- 14
6
votes
1 answer
Running a shell script as a mix alias
How can you run a shell script as a mix alias?
I've tried the following with no luck:
defp aliases() do
[
"test": [ "./scripts/test.sh" ]
]
end
defp aliases() do
[
"test": [ "scripts/test.sh" ]
]
end
Each returns with a variation…

anthonator
- 4,915
- 7
- 36
- 50
6
votes
2 answers
When to use a dot in elixir module name?
I have seen elixir modules named this way:
defmodule Foo.bar.baz do
end
But I can't find any documentation stating when to do this.
Does it have to do with subdirectories? Using mix, I can put my modules in subdirectories within the lib folder, and…

adamkgray
- 1,717
- 1
- 10
- 26
6
votes
2 answers
How can I disable elixir compiler warnings
When I do
mix compile
I get messages like
warning: variable "test_val" is unused
lib/myapp/mymodule.ex:46
I'm just hacking on a side project and I don't care about these warnings for now. Is there a way to turn this off?

csch0
- 523
- 9
- 21
6
votes
1 answer
Error in Elixir : returned a bad value: :ok
I have some problem while working on Elixir.
This is my mix.exs...
defmodule FlockTest.Mixfile do
use Mix.Project
def project do
[app: :flock_test,
version: "0.1.0",
elixir: "~> 1.4",
build_embedded: Mix.env == :prod,
…

Dennis Jung
- 61
- 1
- 3
6
votes
1 answer
** (CaseClauseError) no case clause matching: :eacces - Building release with MIX_ENV=prod
I am not sure where to put that error, elixir, phoenixframework, or nodejs.
I am trying to create my first release build with elxir and phoenix. During the release build I see the following error. I am just not sure if this is a version/dependency…

Andreas Guther
- 422
- 4
- 7
6
votes
1 answer
How can I list all tests using `mix test`
Is there a command-line invocation I can used in conjunction with mix that will output all test names without running the tests?

Michael Bishop
- 4,240
- 3
- 37
- 41
6
votes
1 answer
Running mix tasks in production
I have a number of tasks and jobs that I would like to be able to execute manually on a production elixir application. Currently, I have been performing them by running the code inside the remote_console. I Attempted to run them by using /bin/my_app…

Aaron Dufall
- 1,177
- 10
- 34
6
votes
2 answers
How can I avoid the "warning: redefining module Foo" when running ExUnit tests multiple times in one process
I wish to be able to run the ExUnit tests multiple times from within a running process, such as iex.
To do this I have code that looks somewhat like this:
def test do
# Unload test files
["test"]
|> Mix.Utils.extract_files("*")
|>…

lpil
- 1,702
- 1
- 12
- 22
6
votes
1 answer
Preventing a mix task being included when your project is included as a mix dep
An Elixir library I'm writing has two custom mix tasks, one intended to be used by users who have made my library a dependency of their project, one intended to be used only within my project.
The problem here is that both mix tasks are available to…

lpil
- 1,702
- 1
- 12
- 22
6
votes
2 answers
How to read config files on elixir mix project
I am creating an elixir project to search for patterns in files.
I want to store those patterns a config files to allow for easy changes in the app.
My first idea is storing those files as exs files in the config folder in the mix project.
So, the…

Batou99
- 869
- 10
- 19
5
votes
2 answers
mix deps.get fails, {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:option, :server_only, :honor_cipher_order}}]}
I'm trying to fetch dependencies for my elixir project. I can't tell if Hex is down or not (I was able to fetch just fine this morning). When I run
$ mix deps.get
I see this:
Failed to fetch record for 'hexpm/phoenix_live_reload' from registry…

dopatraman
- 13,416
- 29
- 90
- 154
5
votes
2 answers
Can't access a dependency config in main elixir project
I have a project world_app which I have included in hello_app as a dependency (I have included it as a local dependency if that's relevant)
defp deps do
[
{:world_app, path: "../world_app"}
]
end
The world_app has a config.exs that has this…

Question Mcquestioner
- 411
- 1
- 7
- 16