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
How to pass command line arguements to mix run --no-halt
So I have an Application module which follows this layout:
defmodule Project.Application do
use Application
def start(_type, _args) do
children = [
randomchild1,
randomchild2,
{Project.runapp, "argument" }
]
…

drarkayl
- 1,017
- 7
- 17
3
votes
2 answers
What is the purpose of the "main module" during a new Mix project creation?
As far as I understand (and I may be wrong since I am new to Elixir), one can choose to create a single-app Mix project with multiple .ex files, each with multiple modules in them. And they can be used within each other through alias, import etc.
If…

GuSuku
- 1,371
- 1
- 14
- 30
3
votes
2 answers
Elixir Phoenix not loading env variable at runtime
I am trying to load an API key as a system env from my mac when starting up the phoenix server. What am I getting wrong? these are my steps:
On my mac terminal:
export API_NOTIFICATION_KEY=1234
in my config.exs
config :app,…

john
- 1,057
- 1
- 17
- 28
3
votes
1 answer
Configuring and running a Phoenix Framework application
I can run my application from the terminal using mix phx.server. I decided to create an Elixir project in IntelliJ and move the project files there. My configuration of the Elixir Plugin can be seen below:
This causes the following message to…

dearn44
- 3,198
- 4
- 30
- 63
3
votes
2 answers
How can I exclude a particular file from test coverage analysis?
I have a few files in my Elixir application that I'd like to exclude from the test coverage reporting. I'm not using any fancy coverage tools right now; (though I'm not closed to the possibility of using such tools) I'm just using mix test --cover…

Ashton Wiersdorf
- 1,865
- 12
- 33
3
votes
0 answers
`mix ecto.create` throwing weird localhost:5432 connection error
This is my first time using Elixir + Phoenix. I am simply attempting to run mix ecto.create and I am getting the follow error:
19:08:28.529 [error] GenServer #PID<0.295.0> terminating
** (DBConnection.ConnectionError) tcp connect…

Dwayne XD
- 45
- 7
3
votes
2 answers
Is there a way to make Dialyzer watch code changes?
I'm using dialyxir which appends a dialyzer task to Mix. But it doesn't seem to have any --watch option that would rerun the type checking on file changes.
Is there a CLI way to achieve that?

Ivan Gabriele
- 6,433
- 5
- 39
- 60
3
votes
2 answers
Exclude application in a mix project from startup
I have a dependency that starts an application, but I only want to use its modules and don't want its supervisor running. How do I exclude it from startup?
I have not found anything related to this in mans for app.start, run or in Mix.Project module

Ooba Elda
- 1,622
- 1
- 12
- 18
3
votes
1 answer
Are Elixir structs really immutable?
I'm currently studying Elixir and I'm reading "Functional Web Development with Elixir, OTP and Phoenix", which imo is a great book.
Working at the state machine chapter, I came up with the following code:
defmodule IslandsEngine.Rules do
alias…

Michele Riva
- 552
- 9
- 24
3
votes
2 answers
hex dependencies not found for elixir project - poison, absinthe
I am getting unchecked dependency for environment error for ecto.create and ecto.migrate. I have below mix.exs file dependency entry
defp deps do
[{:phoenix, "~> 1.3"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.3"},
…

Vinayak
- 55
- 4
3
votes
0 answers
I am using Phoenix first time why am I getting this error "application is not available"?
[info] Running Slicker.Endpoint with Cowboy using
http://localhost:4000 You have configured application :Slicker in your
configuration file, but the application is not available.
This usually means one of:
You have not added the application as…

Ankit Dwivedi
- 95
- 1
- 1
- 9
3
votes
0 answers
Is it normal to be on :dev env when running mix test?
I am experiencing an issue where my test/support past is not getting compiled:
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
I decided to…

lapinkoira
- 8,320
- 9
- 51
- 94
3
votes
1 answer
module ConnCase is not loaded and could not be found
Cannot figure out this error.
I have this file:
test/support/conn_case.ex
defmodule ProjectWeb.ConnCase do
@moduledoc """
This module defines the test case to be used by
tests that require setting up a connection.
Such tests rely on…

lapinkoira
- 8,320
- 9
- 51
- 94
3
votes
1 answer
Mix.Shell.cmd error when upgraded to elixir 1.6.1
My code was working fine on elixir 1.5.2 and then I upgraded to elixir 1.6.1. It gave me Mix.Shell.cmd/2 is undefined or private error. This is the code
def run(args) do
file = List.first(args) || "priv/static/apiv1docs.json"
…

script
- 1,667
- 1
- 12
- 24
3
votes
1 answer
Unpacking inner tarball failed: invalid argument
When I try to get the dependencies (mix deps.get) I´m receiving this error:
Updating ecto (Hex package)
Checking package (https://repo.hex.pm/tarballs/ecto-2.2.7.tar)
Fetched package
** (Mix) Unpacking inner tarball failed: invalid argument
I´m…

Renan Grativol
- 1,062
- 15
- 20