otuv

otuv

Could not compile dependency :mint

Hi,

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?

Marked As Solved

dimitarvp

dimitarvp

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.

Next, install mise and then run these:

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.

Also Liked

dimitarvp

dimitarvp

Good to know. Feel free to make a new thread for the new problem.

christhekeele

christhekeele

To summarize the problem/solution, in this thread, for future reference:

Elixir and Erlang are both languages that run on the BEAM VM, but the BEAM is (primarily) installed on systems by installing Erlang/OTP. The Elixir compiler itself is (currently) written in Erlang. So, you will generally need to install Erlang before you can install a working Elixir.

In this instance, the -otp-27 part of mise install elixir@1.18.3-otp-27 indicates that you want a version of Elixir that can compile with an instance of Erlang/OTP that is version 27, hence the need to mise install erlang@27.x first.

LostKobrakai

LostKobrakai

That‘s not correct as stated.

Elixir is commonly installed precompiled. By default those precompiled elixir versions are compiled using the oldest supported otp version. With beam files being forward compatible you can use those compiled beam files with all officially supported otp versions.

This means elixir can only depend on otp features of that oldest otp version though. Sometimes elixir does enable integration with such new features behind compile time flags though, so that given a new enough otp version at compile time those integrations will become available. That‘s what those -otp-xx tags state - getting a precompiled elixir installation compiled with the OTP version of the tag potentially enabling integration with features of that or older otp versions.

In that process no files of elixir would be compiled locally - though compiling from source is always possible.

Now being able to install elixir doesn‘t meant it can run by itself. That‘s where a locally installed erlang starts to be required.

Where Next?

Popular in Questions Top

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
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
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
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
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New

Other popular topics Top

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
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39523 209
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
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
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement