Setting Up an Elixir Environment for Phoenix 1.2 Development

Hello everyone,

I need help setting up a development environment to work on a Phoenix 1.2 project. No, I don’t care if it’s out of date and insecure.

I’m taking “The Complete Elixir and Phoenix Bootcamp” and have really been enjoying it so far. Elixir is ludicrously batteries-included and intuitive enough that for most of the tutorial I was able to guess ahead and beat the instructor to solutions. Pattern matching is wicked.

The second half of the course is taught with Phoenix 1.2 and I don’t really know where to start. Elixir web-setup for Windows only lets me install back to version 1.10.0, and I can’t really find a clear answer on which OTP/Elixir version Phoenix 1.2.5 needs.

Suggestions? Help?

That’s wonderful to hear, welcome to the community!

This much at least I can help with. If you go to the Phoenix project on github the 1.2.5 was made on July 27, 2017. That gives us a rough time frame to go look for Elixir tags: Release v1.5.0 · elixir-lang/elixir · GitHub

It looks like Elixir 1.5.0 was released 2 days prior, so that’s probably the version to use.

Compatibility and Deprecations — Elixir v1.12.3 lists Elixir and OTP compatibility: For you it looks like OTP 18-20 should work.

Fair enough, but understand that trying to get specific, 5.5 year old versions of software running on a platform that is relatively niche in the community (windows) may present a lot of trouble. We haven’t even started on getting whatever the javascript build toolchain from 5.5 years ago looked like going :D. WSL2 might help? Not sure.


Hey Ben, thanks for the friendly, detailed, and fast reply!

The Windows machine is just my gaming box, I’ve got Debian/Fedora laptops lying around. I’ll try on those if I have too much trouble. Worst case scenario I’ll just muddle through the tutorial with the latest version of Phoenix.

Checked the Node releases and saw Node.js 8.11.3 released on 2018-06-12. Luckily this is super easy to install with NVM, but getting the rest of the Phoenix build toolchain may be tricky for sure.

Hopefully the following will be enough, will try and tag this question with Windows and report back if things go well. Things seemed to install just fine after running:

nvm install 8.11.3
choco install erlang --version=20.3
choco install elixir --version=1.5.3

Checking versions:

PS C:\Users\Developer> elixir --version
Erlang/OTP 20 [erts-9.3] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10]

Elixir 1.5.3
PS C:\Users\Developer> node -v

Running mix archive.install hex phoenix 1.2.5 failed, but this worked:

mix archive.install

In the project I had some weirdness getting the npm dependencies installed but this was fixed with npm i -g brunch@2 and running npm install again.

Needed to use Postgres 9, otherwise ecto was throwing errors I couldn’t figure out:

docker run --name <name> -p 5432:5432 
  -e POSTGRES_PASSWORD=<pwd> -d postgres:9

…can’t believe it works lol. Installing things like this on Windows is usually a nightmare, I’ll post back if I have any further issues.


PS C:\Users\Developer\Documents\Elixir\discuss> mix phoenix.server
Compiling 12 files (.ex)
Generated discuss app
[info] Running Discuss.Endpoint with Cowboy using http://localhost:4000
08:48:25 - info: compiled 6 files into 2 files, copied 3 in 1.0 sec
[info] GET /
[debug] Processing by Discuss.PageController.index/2
  Parameters: %{}
  Pipelines: [:browser]
[info] Sent 200 in 31ms
1 Like