RyanFleck

RyanFleck

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?

Marked As Solved

RyanFleck

RyanFleck

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
v8.11.3

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

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

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.

Cheers!

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

Also Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

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.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Which course? I think I would not use a course that is this old.

As far as your specific error goes: You need to add dependences that are compatible with the (incredibly old) version of Elixir that you are using. This is going to be very hard.

Where Next?

Popular in Questions Top

gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36432 110
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127536 1222
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement