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

mix release on Amazon Linux 2

Goal: to be able to run a phoenix, mix release in an ec2 instance (this machine: https://hub.docker.com/_/amazonlinux/) Problem: Running my release produces the following error: /my_app/erts-11.0.3/bin/beam.smp: /lib64/libtinfo.so.6: no version…
Sam Houston
  • 3,413
  • 2
  • 30
  • 46
2
votes
1 answer

How to give a description to an alias defined in mix.exs?

When I define an alias in the mix.exs and run mix help, it just shows its description as "Alias defined in mix.exs". Suppose, for example, I have this mix.exs: defp aliases do [ play: "run --no-halt" ] end Then, the mix help…
Tsutomu
  • 4,848
  • 1
  • 46
  • 68
2
votes
1 answer

mix: create new module in existing project

Is there any handy mix command to add a new module to an existing elixir project? I use elixir 1.10.3 and I have such project structure: apps --api ----mix.exs ----lib ----test --inventory ----mix.exs ----lib ----test --mix.exs I would like to add…
Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192
2
votes
1 answer

Running mix ecto.create command for creating a database in a Phoenix project with a postgresql instaled by brew

I have installed postgres using package manager (brew). After starting the service as background and run this to create database on Phoenix I got this error: dedeco@MacBook-Pro-Dedeco> mix ecto.create …
Andre Araujo
  • 2,348
  • 2
  • 27
  • 41
2
votes
2 answers

How do I avoid ExUnit.start() error when running mix test

When I run mix test on my project, I get the following error and I don't understand why: $ mix test Compiling 2 files (.ex) == Compilation error in file lib/myproject_web/controllers/email_controller_test.ex == ** (RuntimeError) cannot use…
MichaelJones
  • 1,336
  • 2
  • 12
  • 22
2
votes
1 answer

How to merge test report of elixir umbrella app?

We have an elixir umbrella app with 2 child apps. Currently we get 2 test reports as there are 2 child apps. Is there a way to merge the results into one? Current report: Finished in 1.4 seconds 5 tests, 0 failures, 1 excluded Finished in 0.5…
2
votes
1 answer

Invalid Elixir version requirement in mix.exs file

I'm trying to run mix deps.get. When I do, I get the following error: (Mix) Invalid Elixir version requirement in mix.exs file This is my mix.exs file: def project do [ app: :app, version: "0.1.0", elixir: "1.6.6", …
dopatraman
  • 13,416
  • 29
  • 90
  • 154
2
votes
1 answer

In Elixir, Is it possible to modify mix format to make square brackets around final keyword lists mandatory?

Hold a strong belief that explicit is better than implicit, I really dislike that mix format removes the optional square brackets from the final parameter of a function when that function is a keyword list. Is there any way to modify mix format's…
Brian Kessler
  • 2,187
  • 6
  • 28
  • 58
2
votes
3 answers

HTTPoison ArgumentError on Phoenix mix task

I have mix task mix fetch.btc on phoenix app (lib/mix/tasks/fetch.btc.ex): defmodule Mix.Tasks.Fetch.Btc do use Mix.Task def run(_args) do res = HTTPoison.get!("https://blockchain.info/ticker") IO.inspect(res) end end When I run mix…
Alexey Egorov
  • 2,221
  • 2
  • 18
  • 21
2
votes
2 answers

How can I make sure distillery includes Erlang inets in the release?

My application, when trying to run a release, has this fatal issue: ** (MatchError) no match of right hand side value: {:error, {:inets, {'no such file or directory', 'inets.app'}}} It works fine when running it with mix on my localhost, however…
cjm2671
  • 18,348
  • 31
  • 102
  • 161
2
votes
1 answer

How can you run an iex session and a phoenix server attached to the same database and mix environment in production?

When you run a server like MIX_ENV=prod mix phx.server and then on another screen attached to the same server try to run a mix-environment attached iex session like iex -S mix then you get an error and shutdown with a complaint like Failed to start…
Laser
  • 5,085
  • 4
  • 34
  • 48
2
votes
1 answer

Can I split helper modules into different files using ExUnit with Mix?

A couple failed attempts and the documentation here leads me to believe that I have to either define helper modules in test/test_helper.exs or in one of the other test/*.exs files nested under a module (that use ExUnit.Case) in my mix project. Is…
matthiasdenu
  • 323
  • 4
  • 18
2
votes
1 answer

elixir+hex - getting hex error for ranch_proxy_protocol ssl:ssl_accept 3 deprecated

enter code hereI am running below command mix ecto.create && mix ecto.migrate which gives an error ===> Compiling ranch_proxy_protocol ===> Compiling src/ranch_proxy_ssl.erl failed src/ranch_proxy_ssl.erl:90: ssl:ssl_accept/3: deprecated; use…
Vinayak
  • 55
  • 4
2
votes
1 answer

ExUnit - How to pass context to test macros in describe blocks, via named setup functions

Looking at the ExUnit documentation, you can add properties to the context struct with the following pattern: defmodule KVTest do use ExUnit.Case setup do {:ok, pid} = KV.start_link {:ok, pid: pid} # "[pid: pid]" also appears to…
Charlie
  • 4,197
  • 5
  • 42
  • 59
2
votes
1 answer

Conditional compilation for a module inside lib/

Is it possible to exclude/add a module which exists inside lib/ folder for a specific env? defp elixirc_paths(:prod), do: ["lib", "lib/only-prod-module] defp elixirc_paths(_), do: ["lib"] Looks like is being added also to the rest of the…
lapinkoira
  • 8,320
  • 9
  • 51
  • 94