chris-wickens
New to Elixir, I’m trying to compile the default project in the getting started guide and get this error:
mix compile
Compiling 1 file (.ex)
== Compilation error in file lib/kv.ex ==
** (ArgumentError) could not call Module.put_attribute/3 because the module KV.MixProject is already compiled
(elixir 1.15.4) lib/module.ex:2310: Module.assert_not_readonly!/2
(elixir 1.15.4) lib/module.ex:2007: Module.__put_attribute__/5
lib/kv.ex:2: (module)
I encountered an OpenSSL problem I wasn’t able to workaround while installing erlang via asdf on my M1 mac. Eventually had to install erlang through homebrew which I gather is not recommended, so perhaps that may be part of the problem.
elixir 1.15.4-otp-26
erlang 26.0.2
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
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
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
So i have been using ash framework for a while and i love it. However currently the issue im having with ash framework is the error handl...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kip
Welcome to the Elixir community. To help to resolve this are you able to share:
lib/kv.ex? The default on the page you linked to doesn’t have any occurrence ofModule.put_attribute/3so something is different.What the message is telling you is that you are trying to update a module attribute in a module that is already compiled. Since module attributes are a compile-time only feature, they don’t exist after compilation and therefore can’t be updated.
chris-wickens
Hi kip, thanks for the welcome. I’m running the command
mix new kv --module KVto initialise the project same as in the guide. lib/kv.ex is the same as the guide as well and I haven’t changed anything else, I just tried again on a new default project and got the same error.I believe the call to put_attribute is coming from the kernel. Afraid I’ve no idea why it would think I’m trying to update a module attribute after compiling. Removing the moduledoc and doc attributes gives me the same error.
chris-wickens
Downgrading to 1.14.5-otp-26 gives me a different error that makes me think the problem is with the Erlang brew installation. I’ll have another go at getting it installed via asdf.
dimitarvp
Definitely use
asdforrtxand just avoid system-installed Erlang / Elixir.al2o3cr
I don’t know what’s causing this, but that message has come up a couple times recently:
It’s for completely different modules, so it’s likely a symptom and not a cause - but maybe more examples will help somebody track it down.
chris-wickens
I’m sadly having no luck installing Erlang either via asdf or rtx. The error I get in both is:
checking for OpenSSL in /usr/local/Cellar/openssl@3/3.1.1_1... configure: error: neither static nor dynamic crypto library found in /usr/local/Cellar/openssl@3/3.1.1_1...local/share/rtx/plugins/erlang/kerl-home/builds/asdf_26.0.2/otp_src_26.0.2/lib/crypto/configure failed!neither static nor dynamic crypto library foundis the error regardless of whether I attempt to use OpenSSL 3 or 1.1.dimitarvp
It has been a while since I last tinkered but here are the env vars that I have that are not directly related to my working environment but also helpful for having offline docs, shell history,
homebrew-installed tools etc.:I have both
openssl@1.1andopenssl@3installed but as you can see I have only given the former a PATH entry (seems to be related to your problem, you are using v3 and I am using v1.1).chris-wickens
After uncountable attempts I found that reinstalling the asdf erlang plugin allowed me to then install erlang via asdf without the crypto library error, and now
mix compileis building the default project as intended.I did install the erlang plugin slightly differently with
asdf plugin add erlanginstead ofasdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git, don’t see why that would make a difference but I thought I’d note it.Along the way I also reinstalled homebrew but I don’t know whether that made a difference, it didn’t help until after I reinstalled the erlang asdf plugin at least. In the end I only had openssl@3 installed and no flags or options were set in .zshrc.
Thanks everybody for your help!
tt67wq
I also encountered this problem, and later I realized that the data on my Mac was migrated from the Intel version to the Apple version, so underlying libraries like OpenSSL were adapted for x86, so when I compiled Erlang, I saw some Intel-type processes in the monitor. Not only Erlang, but also Python code had some strange phenomena. After uninstalling and reinstalling Homebrew, I reinstalled all language environments such as Python and Erlang, and the problem was solved. I hope this experience can be helpful to you.
Coelepinda
I had the same problem trying to run elixir for the first time (very frustrating). I’m using an m1 chip on macOS Sanoma. As suggested here before, it was most probably an architecture problem because after removing elixir again:
brew uninstall elixirand reinstalling it forcing the architecture to be arm64:
arch -arm64 brew install elixirit worked for me!I noticed that brew was using rosetta 2 since
.
brew configgave backRosetta 2: true. Simple fix and nice if it helps some other people aswell