Elixir 安装依赖项命令 `mix deps.get` 抛出错误

问题描述 投票:0回答:1

安装 Elixir 依赖项时出错,所有 Mix 命令都抛出相同的异常

23:31:44.447 [notice] Application ssl exited: exited in: :ssl_app.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (ArgumentError) could not call Module.put_attribute/3 because the module xyz.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
            (ssl 11.0.2) ssl_app.erl:35: :ssl_app.stop/1
            (kernel 9.0.2) application_master.erl:293: :application_master.start_it_old/4

23:31:44.455 [notice] Application public_key exited: :stopped

23:31:44.455 [notice] Application asn1 exited: :stopped

23:31:44.455 [notice] Application crypto exited: :stopped

23:31:44.456 [error] Task #PID<0.113.0> started from #PID<0.98.0> terminating
** (MatchError) no match of right hand side value: {:error, {:ssl, {:bad_return, {{:ssl_app, :start, [:normal, []]}, {:EXIT, {%ArgumentError{message: "could not call Module.put_attribute/3 because the module xyz.MixProject is already compiled"}, [{Module, :assert_not_readonly!, 2, [file: ~c"lib/module.ex", line: 2310]}, {Module, :__put_attribute__, 5, [file: ~c"lib/module.ex", line: 2007]}, {:ssl_app, :stop, 1, [file: ~c"ssl_app.erl", line: 35]}, {:application_master, :start_it_old, 4, [file: ~c"application_master.erl", line: 293]}]}}}}}}
    (mix 1.15.4) lib/mix/utils.ex:661: Mix.Utils.read_httpc/1
    (mix 1.15.4) lib/mix/utils.ex:589: anonymous fn/2 in Mix.Utils.read_path/2
    (elixir 1.15.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
    (elixir 1.15.4) lib/task/supervised.ex:36: Task.Supervised.reply/4
Function: #Function<5.80278363/0 in Mix.Utils.read_path/2>
    Args: []
** (EXIT from #PID<0.98.0>) an exception was raised:
    ** (MatchError) no match of right hand side value: {:error, {:ssl, {:bad_return, {{:ssl_app, :start, [:normal, []]}, {:EXIT, {%ArgumentError{message: "could not call Module.put_attribute/3 because the module xyz.MixProject is already compiled"}, [{Module, :assert_not_readonly!, 2, [file: ~c"lib/module.ex", line: 2310]}, {Module, :__put_attribute__, 5, [file: ~c"lib/module.ex", line: 2007]}, {:ssl_app, :stop, 1, [file: ~c"ssl_app.erl", line: 35]}, {:application_master, :start_it_old, 4, [file: ~c"application_master.erl", line: 293]}]}}}}}}
        (mix 1.15.4) lib/mix/utils.ex:661: Mix.Utils.read_httpc/1
        (mix 1.15.4) lib/mix/utils.ex:589: anonymous fn/2 in Mix.Utils.read_path/2
        (elixir 1.15.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
        (elixir 1.15.4) lib/task/supervised.ex:36: Task.Supervised.reply/4

尝试过的解决方案

  1. https://dev.to/onpointvn/installing-erlang-elixir-on-m1-macs-1b8g
  2. https://rajrajhans.com/2022/10/installing-elixir-on-mac-m1/

安装 erlang 之前遵循https://github.com/asdf-vm/asdf-erlang#osx部分

MacBook Pro M2 - 操作系统 13.4.1

终端 - 罗塞塔

OpenSSL 3.1.2 2023 年 8 月 1 日(库:OpenSSL 3.1.2 2023 年 8 月 1 日)

Erlang/OTP 26 [erts-14.0.2] [来源] [64 位

Elixir 1.15.4(使用 Erlang/OTP 26 编译)

Mix 1.15.4(使用 Erlang/OTP 26 编译)

节点v18.15.0

NPM9.5.0

.zshrc 文件

有人知道为什么我会收到与 SSL 相关的错误吗?我该如何解决它?

erlang elixir erlang-otp elixir-mix elixir-iex
1个回答
0
投票

我试图在 Rosetta 终端上安装 elixir,切换到本机终端后,遇到了同样的错误,因此从 Rosetta 终端卸载了与 elixir 相关的所有内容,并在本机终端上安装了 homebrew 并遵循 https://elixir-lang。 org/install.html#macos

确保所有必需的依赖项必须使用相同的自制程序安装

© www.soinside.com 2019 - 2024. All rights reserved.