1
votes

I'm trying to run mix phx.new <project_name> in my terminal to start a new phoenix 1.3 project, but I get the error message:

** (Mix) Phoenix v1.3.0-rc.1 requires at least Elixir v1.4.
You have 1.3.2. Please update accordingly

I ran brew install elixir before to get the new version, tried it again and get:

Warning: elixir-1.4.2 already installed

However I run elixir -v it tells me:

Erlang/OTP 19 [erts-8.0] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.3.2

Any help would be greatly appreciated here to help me get running.

1
brew update && brew reinstall elixir ?Sheharyar
@Sheharyar I tried running that and get: ==> Reinstalling elixir ==> Downloading https://homebrew.bintray.com/bottles/elixir-1.4.2.sierra.bottle. Already downloaded: /Users/Me/Library/Caches/Homebrew/elixir-1.4.2.sierra.bottle.tar.gz ==> Pouring elixir-1.4.2.sierra.bottle.tar.gz 🍺 /usr/local/Cellar/elixir/1.4.2: 388 files, 5.5MB But when I run elixir -v, I still get it only showing 1.3.2 again. Thanks for the idea though!Rhett D
What's the output of which elixir ?Sheharyar
try readlink `which elixir`Sheharyar
That means you have another version of elixir installed on your system. You can use readlink to find it's path, remove it and then install the latest version using brewSheharyar

1 Answers

2
votes

This might be happening because phoenix-1.3 is installed with older version of elixir.

Please consider using asdf version manager for elixir.

Once it's installed, just add the elixir plugin. After that you can set the version with asdf global <name> <version> command. e.g. asdf global elixir 1.4.2 and you're done.

It just manages a simple .tool-versions file to manage the version.

In our experience it has worked in almost every scenario, while we had faced problems with homebrew and kiex. Also, it works on Linux, Docker, Windows and Mac so it's safe to use it in order to reduce deployment time hiccups.

If you want to do it with homebrew, first run where elixir and then set the $PATH variable in your .bash_profile or .zsh_profile files accordingly.

After elixir is setup correctly, please install latest version of phoenix (as of this writing it's 1.3, and you may need to install it from archives). But I guess you already have figured that out :)

Please let us know if you still face any problem.