You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Elixir 1.13.4与OTP 25时出现rebar3函数未定义编译错误

解决Elixir 1.13.4 + OTP25下mix编译依赖失败问题

问题根源

当前使用的rebar3是用低于OTP25的版本编译的,OTP25对字节码格式做了变更,导致旧版rebar3无法在OTP25环境中运行,进而引发依赖(如telemetry)编译失败。错误核心提示:

beam/beam_load.c(148):加载rebar3模块出错:请使用Erlang/OTP 25编译器重新编译此模块
escript: 异常错误:未定义函数rebar3:main/1

解决步骤

1. 更新rebar3到兼容OTP25的版本

执行以下命令让Mix自动安装适配OTP25的rebar3:

rm ~/.mix/rebar3
mix local.rebar --force

或者手动下载最新版rebar3替换:

wget https://github.com/erlang/rebar3/releases/latest/download/rebar3
chmod +x rebar3
mv rebar3 ~/.mix/rebar3

2. 清理并重新编译依赖

mix deps.clean telemetry
mix do deps.get, compile

内容的提问来源于stack exchange,提问作者tee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 19:27:34