Questions tagged [elixir-mix]

Mix is a build tool that provides tasks for creating, compiling, testing Elixir projects, as well as handle dependencies, and more.

293 questions
60
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
  • 26,119
  • 31
  • 137
  • 246
36
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
  • 21,512
  • 16
  • 50
  • 70
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
  • 7,253
  • 13
  • 48
  • 74
26
votes
4 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,724
  • 2
  • 15
  • 28
26
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,735
  • 2
  • 12
  • 24
16
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
  • 3,149
  • 4
  • 32
  • 48
14
votes
3 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
  • 225
  • 2
  • 8
13
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
  • 8,891
  • 33
  • 56
13
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.
  • 1,587
  • 2
  • 11
  • 17
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,550
  • 2
  • 14
  • 22
11
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,477
  • 14
  • 27
11
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
  • 822
  • 1
  • 9
  • 16
10
votes
1 answer

Alias all contents of a module/namepsace in IEX

Following the advice in this question regarding how to load iex with the dependencies of the current project I was able to work with phoenix framework dependencies in a pretty productive manner. However, it gets a bit tedious having to provide the…
Graham Conzett
  • 7,984
  • 11
  • 52
  • 93
10
votes
3 answers

Is it possible to get the compiler to exit early, failing the build, if a compile time warning is raised?

I find the compile time warnings very useful, but I can occasionally miss them, especially if it's on a pull request where the tests are running on a CI server. Ideally I would specify something in the project mix file that would make the compiler…
lpil
  • 1,327
  • 1
  • 9
  • 19
10
votes
1 answer

How do I set the default Elixir mix task

If I have a mix.exs file something like: defmodule Mix.Tasks.My_task do use Mix.Task @shortdoc "Perform my task" def run(_) do IO.puts "Working" end end defmodule ElixirKoans.Mixfile do use Mix.Project def project do ... …
Bryan Ash
  • 4,126
  • 3
  • 35
  • 54
1
2 3
19 20