Been away from elixir for a while and tried to create a new phoenix app but run into troubles compiling mint.
I get a large number of problems similar to the one example below (10+ can provide if needed) and then the text telling me it could not compile.
mix phx.server
==> mint
Compiling 1 file (.erl)
src/mint_shims.erl:37:14: can't find include lib "public_key/include/public_key.hrl"
% 37| -include_lib("public_key/include/public_key.hrl").
% | ^
could not compile dependency :mint, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile mint", update it with "mix deps.update mint" or clean it with "mix deps.clean mint"
The entire mashine is a brand new Windows Ubuntu wsl so everything is up to date. I did try to update and compile mint separately but I run into the same problem.
I suppose that it might not be a phoenix specific problem but I’m a bit rusty on the whole thing so I thought I start where the error occur. Where can I start to solve this issue?
Are you using the latest mint? And the latest Erlang (27.something) / Elixir (1.8.3)? After that is checked, I would start with this just to make sure:
I tried exlixir -v and as I understand I seem to use Erlang 25 and Elixir 1.14.
I installed it all fresh yesterday minutes after creating the machine so it would be unfortunate if the current Elixir package lags three Erlang versions behind?
Do yourself a favor and just never use native Linux packages for this. Very few distros keep up with them properly (Manjaro comes to mind). Uninstall Erlang & Elixir from your package manager.
mise install erlang@27.3.3
mise install elixir@1.18.3-otp-27
mise use -g erlang@27.3.3
mise use -g elixir@1.18.3-otp-27
The last two just set the default versions of Erlang and Elixir so you don’t have to set them per project (though you can do that as well inside each individual project’s directory, just remove the -g switch from the use command).
Mind you, I have no idea if Erlang/Elixir versions are your problem. But it’s a good starting point to make sure you are where almost everybody else is first.
It did solve my current issue but of cause there is a new one instead. But thank you for clearing this out.
One thing for anyone following this advice in the future. I had to run mise use -g erlang@27.3.3
before I ran mise install elixir@1.18.3-otp-27
otherwise I would get some erlang does not exist issue
I’ve thought a bit about this answer and while it is not an actual description of how to solve the issue. It is a good example of the threshold of development. To navigate dependencies and what tools to use.
I could make use of that thread but someone with less experience would just be confused