說(shuō)明:rebar分為兩個(gè)版本:rebar與rebar3。第一種介紹使用源碼安裝rebar3,第二種介紹使用brew安裝rebar
一朽砰、Mac OS Install Rebar3
- 1.下載源碼:
$ git clone https://github.com/erlang/rebar3.git
終端打印信息:
mac-2:Erlang julong$ git clone https://github.com/erlang/rebar3.git
Cloning into 'rebar3'...
remote: Enumerating objects: 56, done.
remote: Counting objects: 100% (56/56), done.
remote: Compressing objects: 100% (46/46), done.
remote: Total 18993 (delta 24), reused 30 (delta 10), pack-reused 18937
Receiving objects: 100% (18993/18993), 5.55 MiB | 432.00 KiB/s, done.
Resolving deltas: 100% (13004/13004), done.
- 進(jìn)入到rebar3目錄下:
cd rebar3/
- 執(zhí)行下面命令:
./bootstrap
終端打印信息:
===> Verifying dependencies...
===> Fetching bbmustache ({pkg,<<"bbmustache">>,<<"1.6.1">>})
===> Version cached at
...
===> Linking _build/default/lib/bbmustache to _build/bootstrap/lib/bbmustache
===> Linking _build/default/lib/certifi to _build/bootstrap/lib/certifi
===> Compiling rebar
===> Building escript...
- 安裝:
./rebar3 local install
終端打印信息:
===> Extracting rebar3 libs to /Users/julong/.cache/rebar3/lib...
===> Writing rebar3 run script /Users/julong/.cache/rebar3/bin/rebar3...
===> Add to $PATH for use: export PATH=/Users/julong/.cache/rebar3/bin:$PATH
- 復(fù)制到bin目錄下,方便以后調(diào)用:
cp rebar3 /usr/local/bin/
- 6 測(cè)試:終端執(zhí)行下面命令:
rebar3 -v
二、Mac os install Rebar
- 打開(kāi)終端執(zhí)行以下操作
brew install rebar
如未安裝brew,請(qǐng)參考→http://www.reibang.com/p/19e4127a71c3