title: mix deps.get: Hex got installed into wrong elixir version
body: <p>This is my first time using the command:</p>
  
  <pre><code>$ mix deps.get
  </code></pre>
  
  <p>This was the output:</p>
  
  <pre><code>Could not find Hex, which is needed to build dependency :ecto
  Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] Y
  * creating /Users/7stud/.kiex/mix/archives/elixir-1.4.1/hex-0.18.1
  Resolving Hex dependencies...
  Dependency resolution completed:
  New:
    connection 1.0.4
    db_connection 1.1.3
    decimal 1.5.0
    ecto 2.2.10
    poolboy 1.5.1
    postgrex 0.13.5
  * Getting ecto (Hex package)
  * Getting postgrex (Hex package)
  * Getting connection (Hex package)
  * Getting db_connection (Hex package)
  * Getting decimal (Hex package)
  * Getting poolboy (Hex package)
  
  
  ~/elixir_programs/friends$ iex
  Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
  
  Interactive Elixir (1.6.6) - press Ctrl+C to exit (type h() ENTER for help)
  iex(1)&gt; 
  
  ^C$ which iex
  /Users/7stud/.asdf/shims/iex
  
  $ which elixir
  /Users/7stud/.asdf/shims/elixir
  
  $ asdf current
  elixir         1.6.6   (set by /Users/7stud/.tool-versions)
  erlang         20.3    (set by /Users/7stud/.tool-versions)
  
  $ asdf list elixir
  1.6.6
  
  $ asdf list erlang
  20.3
  </code></pre>
  
  <p>I installed <code>otp 20.3</code> and <code>elixir 1.6.6</code> with the <code>asdf</code> package manager:</p>
  
  <pre><code>^C$ which iex
  /Users/7stud/.asdf/shims/iex
  
  $ which elixir
  /Users/7stud/.asdf/shims/elixir
  
  $ asdf current
  elixir         1.6.6   (set by /Users/7stud/.tool-versions)
  erlang         20.3    (set by /Users/7stud/.tool-versions)
  
  $ asdf list elixir
  1.6.6
  
  $ asdf list erlang
  20.3
  </code></pre>
  
  <p>I don't care what package manager I use.  How can I make sure things like Hex are installed in elixir 1.6.6?  I can't even find elixir 1.4.1 on my system:</p>
  
  <pre><code>$ elixir -v
  Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
  
  Elixir 1.6.6 (compiled with OTP 19)
  </code></pre>
  
  <p>so how did the Hex installer find elixir 1.4.1?</p>
  
  <p>If I remove the lines in my <code>.bash_profile</code> that install the <code>asdf shims</code>, and then I open a new terminal window, this is what I get:</p>
  
  <pre><code>~$ which elixir
  /Users/7stud/.kiex/elixirs/elixir-1.4.1/bin/elixir
  
  ~$ which mix
  /Users/7stud/.kiex/elixirs/elixir-1.4.1/bin/mix
  ~$ 
  </code></pre>
  
  <p>I searched google for <code>.kiex</code>, and it looks like I must have installed the <code>kiex</code> version manager for elixir at some point.</p>
  
  <p>There were also some lines in my <code>.bash_profile</code> that installed <code>kiex</code> shims. I commented out the lines for <code>kiex</code> and uncommented the lines for the <code>asdf</code> shims, and I opened a new terminal window, and I tried the mix command again:</p>
  
  <pre><code>$mix deps.get 
  Could not find Hex, which is needed to build dependency :ecto
  Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] Y
  * creating /Users/7stud/.asdf/installs/elixir/1.6.6/.mix/archives/hex-0.18.1
  Resolving Hex dependencies...
  Dependency resolution completed:
  Unchanged:
    connection 1.0.4
    db_connection 1.1.3
    decimal 1.5.0
    ecto 2.2.10
    poolboy 1.5.1
    postgrex 0.13.5
  All dependencies up to date
  </code></pre>
  
  <p>Success.</p>
  
  <p>Next problem:</p>
  
  <pre><code>~/elixir_programs/friends$ mix exto.gen.repo -r Friends.Repo
  ==&gt; connection
  Compiling 1 file (.ex)
  Generated connection app
  ==&gt; friends
  Could not find "rebar", which is needed to build dependency :poolboy
  I can install a local copy which is just used by Mix
  Shall I install rebar? (if running non-interactively, use "mix local.rebar --force") [Yn] 
  </code></pre>
  
  <p>But, in another terminal window:</p>
  
  <pre><code>$ which rebar
  /usr/local/bin/rebar
  
  ~$ rebar --version
  rebar 2.6.4 19 20170625_072305 git 2.6.4-6-g2a52f60
  
  ~$ which rebar3
  /usr/local/bin/rebar3
  
  ~$ rebar3 --version
  rebar 3.0.0-beta.4+build.3189.ref21ae314 on Erlang/OTP 20 Erts 9.3
  </code></pre>
  
  <p>So, why can't mix find my rebar?</p>