Skip to content

Instantly share code, notes, and snippets.

@janewang
Created August 10, 2012 20:27
Show Gist options
  • Save janewang/3317595 to your computer and use it in GitHub Desktop.
Save janewang/3317595 to your computer and use it in GitHub Desktop.
Rebar Setup
mkdir testing_rebar
cd testing_rebar
rebar create-app
console output:
==> testing_rebar (create-app)
Writing src/myapp.app.src
Writing src/myapp_app.erl
Writing src/myapp_sup.erl
# src directory is created
mkdir -p apps/myapp
mv src apps/myapp
# moves src directory into apps/myapp directory
mate rebar.config
# create config files with
# {sub_dirs, ["apps/myapp", "rel"]}.
rebar compile
console output:
==> myapp (compile)
Compiled src/myapp_app.erl
Compiled src/myapp_sup.erl
==> testing_rebar (compile)
mkdir rel
cd rel
rebar create-node
# or 2nd option: (rebar create-node nodeid=myapp)
console output:
==> rel (create-node)
Writing reltool.config
Writing files/erl
Writing files/nodetool
Writing files/mynode
Writing files/sys.config
Writing files/vm.args
Writing files/mynode.cmd
Writing files/start_erl.cmd
Writing files/install_upgrade.escript
mate reltool.config
# add {lib_dir, "../apps/myapp"}
# to {app, myapp, [{mod_cond, app}, {incl_cond, include}]}
# to become {app, myapp, [{mod_cond, app}, {incl_cond, include}, {lib_dir, "../apps/myapp"}]}
# inside rel directory
rebar -v generate
console output:
==> rel (generate)
mynode/bin/mynode console
note: (2nd option) myapp/bin/myapp console
# full path is rel/mynode/bin/mynode console from root dir
# starts in the shell
Eshell > registered().
Slight update to this setup: http://skeptomai.com/?p=56 due to version difference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment