Deps issue: (Mix) Hex dependency resolution failed, relax the version requirements or unlock dependencies

(Mix) Hex dependency resolution failed, relax the version requirements or unlock dependencies

I have faced the issue when you add new dependancy to your Elixir project and appeared it used different version of some deps (because developer fixed deps version).
Continue reading “Deps issue: (Mix) Hex dependency resolution failed, relax the version requirements or unlock dependencies”

bash: line 10: mix: command not found when building Elixir app with edeliver

Another dummy error which could be fixed in a minute.

$ mix edeliver build release                  

BUILDING RELEASE OF AWESOMEBOT APP ON BUILD HOST

-----> Authorizing hosts
-----> Ensuring hosts are ready to accept git pushes
-----> Pushing new commits with git to: [email protected]


-----> Resetting remote hosts to 568e7c43e372ed947e45e3dfe2a641f5dc771bf4
-----> Cleaning generated files from last build
-----> Fetching / Updating dependencies
using mix to fetch and update deps
bash: line 10: mix: command not found

FAILED 127:

    [ -f ~/.profile ] && source ~/.profile
    set -e
    cd /home/bots/apps/builds
    if [ "mix" = "rebar" ]; then
      echo "using rebar to fetch and update deps"
      ./rebar  update-deps get-deps
    elif [ "mix" = "mix" ]; then
      echo "using mix to fetch and update deps"
      if [ ! -f ~/.mix/rebar ]; then
        APP="awesomebot" MIX_ENV="prod" mix local.rebar
      else
        echo "rebar for mix was built already"
      fi
      APP="awesomebot" MIX_ENV="prod" mix local.hex --force
      APP="awesomebot" MIX_ENV="prod" mix deps.get
    fi

Solution is simple -you need to install `mix`, so follow the instructions here: http://elixir-lang.org/install.html#unix-and-unix-like

Add Erlang Solutions repo: wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
Run: sudo apt-get update
Install the Erlang/OTP platform and all of its applications: sudo apt-get install esl-erlang
Install Elixir: sudo apt-get install elixir