few days ago I changed my GPU and I had to switch from Linux to Windows. I consider learning Docker instead of installing Elixir on my machine. Is it worth my time? I’m still learning Elixir basics and I don’t have any experience with Docker, but I thought that maybe it’s a good idea and some kind of investment for the future.
Unfortunately, virtual machines don’t work well on my machine, they are pretty slow and I have bad experience with using them.
If I am using windows, I use WSL2. With this i can treat it as any other Linux machine. You do not need to use docker, but If you did, it has nice integration with WSL.
My main current machine runs Windows 10, and having come to it from Linux (Fedora) I’ll attest to WSL2 working remarkably well. I brought my Linux dotfiles along (making a few wsl-specific edits here and there), and I have an environment that feels pretty comfortable. Windows terminal is finally good enough to live in. From day to day I hardly notice that I’m effectively working in a VM. Performance is impressive - within a few percent of running Linux on bare metal. You can even use your GPU from WSL (though until the final WSLg release it involves running a Windows Insider build, so probably better to wait a few months for that).
Agree that adding the burden of learning Docker seems like an unnecessary barrier.
Went that route before and can’t quite recommend that. The “elixir experience” on pure Windows can become quite frustrating sometimes although it might have changed since the last time I used it. One of the things that ground my gears back then was that IEx autocompletion simply didn’t work (and werl is just not really a good alternative to a terminal workflow. Besides, it is ugly AF)
You are better off just using WSL2 with whatever distro you like best. It’s just easier to set up and you won’t have problems with libraries where UNIX support is first class. Just less headache overall.
IEx autocompletion, no asdf and sometimes symbols/colours in the terminal are weird are what I notice is lacking, but I figure typing everything means I commit things to memory better.
My app is designed to run on Windows only and interacts with other Windows software through a dll, so I don’t have a choice
I made a small research about Docker and it seems to work a little bit different than I thought. I just set up WSL2 with Ubuntu and installed elixir (sudo apt install erlang elixir), but I have some troubles with ElixirLS.
Install elixir and erlang with asdf or using the instructions from Installing Elixir - The Elixir programming language, the versions available on the default repos for ubuntu 20.04 (which is the most common in WSL2) aren’t that updated.
IIRC the default elixir version in the ubuntu repos is 1.9 and elixir-ls depends on 1.10.
It means that the lsp isn’t even starting, I don’t know if the esl-erlang package provides the erlang in the same way as the ubuntu package, did you updated the erlang package too or only the elixir?
By the way, did you use the repo or asdf to update?
If you don’t find anything, perhaps add a post here with some more info about exactly how you’re opening a project in vscode (eg. is it from the command line at the root of a mix project?), and maybe scan the elixir-ls log output & include anything that seems relevant.
Ok, I solved problem by switching from Ubuntu to OpenSUSE Leap 15.3. I don’t know what exactly caused this error, but default elixir (1.11.3) and erlang packages from repository seem to work just fine.
Thanks for all replies, I appreciate that. At this moment I will not learn docker and just go with WSL2.
I assume you were trying to start it with systemctl, which won’t work without systemd. Not sure what OpenSUSE comes with, but most distros have service to run System V init scripts [edit - system can also start systemd units, which most packages designed, like postgres, to be run as services will install these days]. Try which service to see if you have it, then if it’s there, man service to read up on how to use it.
If things are set up right, sudo service postgresql start should get you started. I admit I haven’t gone to the trouble of automating starting services in my wsl - as my system keeps running for weeks on end it’s no trouble to just run this on reboot. But it can be done if needed.