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
0
votes
1 answer

How to fix "** (Mix) The task "compile.all" could not be found" when I run `mix test`

Recently started using exercism to learn elixir and I'm running into issues using mix. I'm completely new to using this tool so I've probably missed something basic. When I run mix test in a directory with a tests subdirectory I get an error. **…
nick
  • 1
0
votes
1 answer

How do you define a mix task in an exs file and still run it the same?

If I had a mix task such as the following defined in hello.ex, it runs fine. defmodule Mix.Tasks.Hello do use Mix.Task def run(_), do: IO.puts "hello" end But this doesn't seem possible in a "hello.exs" type file? Or is there a way to have a…
Nona
  • 5,302
  • 7
  • 41
  • 79
0
votes
1 answer

Elixir - setting MIX_ENV on a Mac yields FunctionClauseError

I'm having trouble getting my Elixir apps to read the MIX_ENV variable from the local environment on my Mac. For example, running the command $ MIX_ENV=prod iex -S mix throws the following error: ** (FunctionClauseError) no function clause…
skwidbreth
  • 7,888
  • 11
  • 58
  • 105
0
votes
1 answer

Trying to read a webpage in Hound, I get a compilation error for Hound.start_session

I started a new project and configured it like so: mix new example cd example I emptied ´lib/example.ex´ and placed the following code there: Application.start :hound defmodule Example do use Hound.Helpers def run do Hound.start_session …
Alex V
  • 3,416
  • 2
  • 33
  • 52
0
votes
0 answers

Elixir App runs with iex but not when releasing

I'm facing the following issue in an Elixir project and I would appreciate any kind of help. my_service/mix.exs def application do [ extra_applications: [:foo_lib], mod: {My.Application, []} ] end When I'm running the app using…
funk
  • 2,221
  • 1
  • 24
  • 23
0
votes
0 answers

heroku run mix command not found

while deploying a Phoenix project, on Heroku it is saying mix command not found I checked the Buildpacks of elixir and Phoenix are installed, pushed the code also before running the task. tried after doing changes in the bashrc file (commented the…
0
votes
1 answer

LIbrary paths for mix compile process

After moving from brew to asdf version control tool for Elixir and Erlang I still cant compile my old projects: in the compile process it tries to refer to non-existent Brew's Cellar lib files: MacBook-Pro% mix test ==> gettext Compiling 1 file…
Roaring Stones
  • 1,054
  • 7
  • 22
0
votes
1 answer

Application not restarting after normal exit

I am trying to connect to mqtt using tortoise. When my connection drops it connects on the with no problem but when my application exits it is not getting restarted according to :one_to_one strategy. I started application in mod of mix.exs. Shall I…
Yugandhar Chaudhari
  • 3,831
  • 3
  • 24
  • 40
0
votes
1 answer

How to run many mix phx.gen.html commands in one .exs script

I'm trying to rum many mix phx.gen.html commands from a script but only first command is executed. I tried different ways, some of them are below, but nothing worked: Mix.Task.run "phx.gen.html", Parser.parse "Contacts Skype skypes…
AndreyKo
  • 1,421
  • 2
  • 11
  • 25
0
votes
1 answer

Prevent mix deps.get using the network if the deps are up to date?

I'm attempting to make an escrow build of some Elixir code. That is: I want to provide a tarball that contains everything needed to build my project. So: I run mix deps.get while building the tarball, which works fine. To verify that the build has…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
0
votes
0 answers

Configure indentation in mix formatter

In my Phoenix app I have the following code: attrs = %{"name" => "mat", "color" => "blue"} conn = post(conn, Routes.session_path(conn, :create), player: attrs) expected_player = %Player{name: "mat", color: "blue"} the…
Mateusz Urbański
  • 7,352
  • 15
  • 68
  • 133
0
votes
3 answers

hex packages location on linux

I'm scanning an Elixir project by reading the mix.lock file and parsing the output of mix deps.tree command. Later on I need to locate each dependency's .tar file. On my windows machine the location is inside the…
eRez
  • 257
  • 8
  • 24
0
votes
1 answer

Elixir: Scheduled jobs not running Mix task after the first call

I'm using Quantum to handle cron jobs. The setting is the following: application.ex def start ... children = [ ... worker(MyApp.Scheduler, []) ] opts = [strategy: :one_for_one, name: MyApp.Supervisor] …
ntonnelier
  • 1,539
  • 3
  • 23
  • 49
0
votes
1 answer

Unable to run cron tasks without phx.server running

I'm developing an app in my desktop computer (Mac OS) for which I created some cron tasks that run every 5 minutes. The code is the following (taken from here): defmodule MyApp.CronJobs do use GenServer @shops ["billa","kaufland","lidl"] …
ntonnelier
  • 1,539
  • 3
  • 23
  • 49
0
votes
1 answer

get only prod mix dependencies

Having: defp deps do [ {:poison, "~> 3.0"}, {:credo, "~> 0.10.0", only: [:dev, :test], runtime: false} ] end I am doing something like this to ensure all dependencies are started: MixProject.project() |>…
lapinkoira
  • 8,320
  • 9
  • 51
  • 94