Saturday, August 18, 2012

Erlang Application with rebar

The basho guys did a great job for the erlang community for creating rebar which makes creating erlang/OTP applications easier. Rebar allows you to create apps, generate releases and upgrades all based on OTP standards.

1. Make sure you have erlang installed. Check out erlang website for instructions

2. Download rebar. I'd recommend the modified version by OJ available here

3. Extract the content to a folder. cd into that folder and run sudo ./bootstrap

4. You should get a build of rebar available in that folder. For easy access, copy the rebar file into your path, basically /usr/bin folder. Now we are ready to create our erlang app

5. Create a folder in your home directory e.g mkdir ~/sampleapp

6. Navigate into that folder cd ~/sampleapp

7. Run sudo rebar create-app appid=sampleapp. This will create the skeleton of our erlang app.

You can run make commands to compile and generate releases for your erlang app and don't forget to edit rebar.config to include dependencies.
You can read more on rebar and the available commands on the internet.

Cheers.

No comments:

Post a Comment