检查旧版本
| $ uname -a |
| Linux ws-ersyia-0 5.4.241-1-tlinux4-0017.10 |
| ➜ /workspace elixir --version |
| Erlang/OTP 24 [erts-12.3.2.17] [source] [64-bit] [smp:8:2] [ds:8:2:10] [async-threads:1] [jit] |
| |
| Elixir 1.13.3 (compiled with Erlang/OTP 22) |
卸载旧版本
| $ where elixir |
| $ where erl |
| $ rm -rf /opt/elixir /opt/erlang |
下载安装包
| $ wget https://github.com/erlang/otp/releases/download/OTP-27.0.1/otp_src_27.0.1.tar.gz |
| $ wget https://github.com/elixir-lang/elixir/archive/refs/tags/v1.17.2.zip |
安装 erlang
| $ tar zxvf otp_src_27.0.1.tar.gz |
| $ cd otp_src_27.0.1 |
| $ ./configure && make && make install |
| $ erl -s erlang halt |
| Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:8:2] [ds:8:2:10] [async-threads:1] [jit:ns] |
安装 elixir
| $ unzip v1.17.2.zip |
| $ cd elixir-1.17.2 |
| $ make clean compile |
| $ ./bin/elixir --version |
| Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:8:2] [ds:8:2:10] [async-threads:1] [jit:ns] |
| |
| Elixir 1.17.2 (compiled with Erlang/OTP 27) |
配置 PATH
添加路径到PATH
| export PATH=$PATH:/workspace/elixir-1.17.2/bin |
如果要配置文件立即生效,还需要source一下配置文件
查看版本:
| $ elixir |
| Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:8:2] [ds:8:2:10] [async-threads:1] [jit:ns] |
| |
| Elixir 1.17.2 (compiled with Erlang/OTP 27) |
mix ok & install rebar3
配置mix hex和rebar3
| $ mix local.hex -y |
| $ wget https://s3.amazonaws.com/rebar3/rebar3 |
| $ chmod +x ./rebar3 |
| $ ./rebar3 local install |
| |
| $ vim ~/.zshrc |
| export PATH=/root/.cache/rebar3/bin:$PATH |
| |
| $ rebar3 -v |
| rebar 3.23.0 on Erlang/OTP 27 Erts 15.0.1 |
如果要配置文件立即生效,还需要source一下配置文件
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律