Fl4m3Ph03n1x

Fl4m3Ph03n1x

How to have latest version of Elixir in Windows

Background

I am on a Windows machine and I am looking to install the latest version of elixir in it. This is being harder than expected.

Research

Initially I searched for something similar to asdf for Windows, but there is nothing similar for this platform. Scoop is the tool that comes closest, but it requires me to do custom scripts and to learn another tool, both things I am not a fan of right now:

Then I turned to chocolatey:

Which looks perfect, but it is severely outdated, being only in version 11.X
No signal of any updates to come, so this one is out as well.

My last hope, is perhaps Docker …

It looks like there is a version of 12.X, which hopefully uses OTP 24 (my goal):

Questions

However, I am not convinced yet. My only experiences with Docker containers were brutally painful. I understand things have changed in the meantime and that Docker seem to be a solution most developers fight for.

However, I am not sure if investing in this tool (remember, I discarded scoop because I didn’t want to invest in it) is going to pay off:

  • Will I be able to create releases for Windows using a container?
  • Will I be able to create releases for Ubuntu as well? (I am fairly sure I won’t be able to because my host is Windows, but just confirming)
  • Do you guys recommend any guides for Windows?

Alternatives

I feel like I am reaching for the bottom of the barrel here. I am honestly running out of options. Any ideas would be welcome.

Marked As Solved

Fl4m3Ph03n1x

Fl4m3Ph03n1x

Answer

This one was not easy. I had to wait for the Windows binaries to be ready.
The only way of getting the cutting edge release is to compile it myself.

Step 1

However, if this is something you can’t do, to have the latest Erlang/OTP
versions you have to go here:

Here I downloaded Erlang/OTP 24.

Step 2

After that, I downloaded the official version of Elixir for Windows, and configured it to use my already installed version of Erlang/OTP (which it does by default):

Step 3 (Optional)

The final step, if you want to have a desktop app with Elixir, is to download the WebView support for Edge:

https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/b97b52c3-9a66-419c-9ef0-90e3a3f72c5c/MicrosoftEdgeWebview2Setup.exe

Done !

Also Liked

webuhu

webuhu

I myself use a custom scoop bucket, but what it does can simple be done without it.

  1. Choose your disired precompiled elixir version from https://repo.hex.pm/builds/elixir/builds.txt
  2. Download from e.g. https://repo.hex.pm/builds/elixir/v1.12.3-otp-24.zip
  3. Extract and set the bin folder to your windows path

Edit:
Of course you have to take care of the runtime Erlang version installation separately.
No, creating a release on native Windows for Ubuntu won’t work.
But creating a release for Windows within a Docker container won’t work ether in my view.

IloSophiep

IloSophiep

I don’t feel qualified answering all of your questions, but for this one: Using a tool like Docker Desktop you can run both windows images and unix images on a Windows host. As far as I know you cannot manage them at the same time but I frequently switch between “using windows containers” and “using Linux containers” depending on my current needs

LostKobrakai

LostKobrakai

While the installer may not be that flexible you can always compile from source: Windows · elixir-lang/elixir Wiki · GitHub

The installer is just a convenience to hide the complexities involved for windows users and the (pre-)build versions only support the lowest supported otp version.

dominicletz

dominicletz

Creator of Elixir Desktop

For elixir-desktop I also needed recent windows binaries, so I did contribute a GitHub CI job for windows some time ago. So you can get the most recent Erlang binaries directly from the official OTP GitHub Repo. Just go to the commit of the release you want, click on the green CI checkmark and choose “artifacts” from there. E.g. this is the link for the 24.0.5 build:

https://github.com/erlang/otp/runs/3200506702

For Elixir, I’m not sure whether it changed but if I remember correctly it will just use whatever Erlang version is in your System PATH variable. So if you use windows native just set the path environment variable to the folder where your erl.exe is.

If you’re using msys2 (which I recommend) then you can make the change in your .bashrc

Cheers!

Where Next?

Popular in Questions Top

bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
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
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
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
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

We're in Beta

About us Mission Statement