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.

339 questions
11
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,702
  • 1
  • 12
  • 22
11
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,385
  • 3
  • 41
  • 57
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
  • 8,344
  • 11
  • 55
  • 94
10
votes
1 answer

Mixed Erlang/Elixir projects - can I use mix or rebar?

For Erlang code, I use rebar. For Elixir code, I use the built-in mix tool. Now I want to have a mixed Erlang/Elixir project. Can I use rebar to compile Elixir code? Or can I use mix to compile Erlang code? If so, how?
Stratus3D
  • 4,648
  • 4
  • 35
  • 67
9
votes
2 answers

Elixir "Package not found in registry: :hackney" problem

I am attempting to add coverage to my project, but keep running into problems. I've attempted all the suggestions in the error message at the bottom of this listing. I have a large project that I wish to add coverage for unittest, but all the…
Trailing Dots
  • 378
  • 1
  • 12
9
votes
1 answer

When should I generate a mix umbrella vs a phoenix umbrella?

I'm not sure when to use mix and when to use phoenix for creating umbrella applications. I have read a lot of articles online but they are not clear of the reasoning for using mix over phoenix and vis versa. mix gives: - apps/ - config/ phoenix…
Loading...
  • 863
  • 9
  • 21
9
votes
1 answer

'Task could not be found' for custom mix task

I have a task Thing in lib/mix/tasks/thing.exs The code is: defmodule Mix.Tasks.Thing do use Mix.Task def run(_) do IO.puts "hello world" end end When I run mix thing or mix Thing I get The task thing could not be found or The task…
user2355213
  • 447
  • 4
  • 13
8
votes
2 answers

How do you get the elixir compiler to show warnings when running a phoenix server?

Running a phoenix server in iex session via mix, like: iex -S mix phx.server Will sometimes give a list of warnings like: Compiling 1 file (.ex) warning: variable "user" is unused lib/app_web/controllers/user_controller.ex:37 But seemingly only…
Laser
  • 5,085
  • 4
  • 34
  • 48
8
votes
3 answers

Elixir's `mix format` configuration options

I'm trying to find a list a configurable options for mix format to put in the formatter config file, but I can't for the life of me find it. It's not in the mix format docs or anywhere else I've looked. Anyone know where I can find this…
Ian
  • 544
  • 3
  • 16
8
votes
8 answers

How to fix "could not compile dependency :bcrypt_elixir" error on Windows?

I'm on Windows and I am trying to install the bcrypt_elixir module. I get the following error: $ mix phx.server ==> bcrypt_elixir could not compile dependency :bcrypt_elixir, "mix compile" failed. You can recompile this dependency with "mix…
William
  • 4,422
  • 17
  • 55
  • 108
8
votes
4 answers

How do I run a mix task from within a mix task?

I would like to run a mix task from within a custom mix task. Something like def run(_) do Mix.Shell.cmd("mix edeliver build release") #do other stuff But I cannot figure out how to execute a shell command. If there is any easier way (besides…
Fletcher Moore
  • 13,558
  • 11
  • 40
  • 58
8
votes
2 answers

mix deps.get fails (dependency issue)

i'm quite new to elixir and phoenix (and ubuntu) and have been battling to get myself up and running with web development. upon creating a new phoenix application using mix phoenix.new webapp i get the following errors from terminal Fetch and…
8
votes
4 answers

Mix (elixir) no such file or directory

I am trying to install elixir in ubuntu... I had followed this instructions. Everthing seems fine, but when I try to execute the mix comand, system asnwered me this: bash: /usr/bin/mix: No such file or directory Thanks you.
Eloy Fernández Franco
  • 1,350
  • 1
  • 24
  • 47
7
votes
1 answer

How do I run `iex -S mix` without compiling changed files?

Say I'm writing a new module, the code isn't ready yet and I want to test something in the repl. I run iex -S mix and it fails because of compilation errors I didn't intend to fix yet. I presume there is a last compiled version of my app that I…
Morozov
  • 2,719
  • 2
  • 21
  • 23
7
votes
1 answer

Attach an iex shell to a running elixir application

I have an elixir (mix) application running on heroku I'm having issues attaching a remote iex shell to this application The application is launched via this command : web: MIX_ENV=prod elixir --sname server -S mix run --no-halt I have no trouble…
MrRuru
  • 1,932
  • 2
  • 20
  • 24
1
2
3
22 23