otuv

otuv

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?

Showing Posts 1 to 10

dimitarvp

dimitarvp

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:

rm -rf deps _build
mix do deps.get, compile
otuv

otuv OP

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?

Erlang/OTP 25 [erts-13.2.2.5] [source] [64-bit] [smp:20:20] [ds:20:20:10] [async-threads:1] [jit:ns]

Elixir 1.14.0 (compiled with Erlang/OTP 24)

Would it help to make a fresh start and install Erlang first, separately from the Elixir package?

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.

otuv

otuv OP

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

dimitarvp

dimitarvp

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

otuv

otuv OP

After a bit of searching it turned out that you had already answered that problem in another thread.
Thank you for the forethought :slight_smile:

dimitarvp

dimitarvp

I’m flattered. Would you link it here so it benefits future readers, please?

otuv

otuv OP

Errors when using asdf install - configure: error: No curses library functions found - Questions / Help - Elixir Programming Language Forum

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 :slight_smile:

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.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
ryanwinchester
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted” Version...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews