Rebar3 安装

Rebar3 安装

Gelomen Lv2

安装 rebar3 便于 Erlang 编译、配置管理和发布

下载或生成 rebar3

编译过的稳定版

下载 rebar3 文件并赋予可执行属性

1
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3

从源码编译生成

前提是已经 安装 Erlang, 然后从仓库将源文件拉取下来并编译生成 rebar3

1
2
3
git clone https://github.com/erlang/rebar3.git
cd rebar3
./bootstrap

完成后在目录下会出现 rebar3 文件

安装

1
./rebar3 local install

将会看到

1
2
3
===> Extracting rebar3 libs to YourHome/.cache/rebar3/lib...
===> Writing rebar3 run script YourHome/.cache/rebar3/bin/rebar3...
===> Add to $PATH for use: export PATH=YourHome/.cache/rebar3/bin:$PATH

添加全局环境变量

1
sudo vi /etc/profile

复制安装后提示的 export 语句, 并在 profile 最后加入

config profile
1
+ export PATH=~/.cache/rebar3/bin:$PATH

测试

1
rebar3 compile
  • 标题: Rebar3 安装
  • 作者: Gelomen
  • 创建于 : 2021-03-25 19:25:48
  • 更新于 : 2021-03-25 19:25:48
  • 链接: https://gelomen.github.io/posts/install-rebar3/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论