<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Erlang Central - Medium]]></title>
        <description><![CDATA[Community-drive tutorials of #Erlang programming language. Content: admin@erlangcentral.org - Medium]]></description>
        <link>https://medium.com/erlang-central?source=rss----e9636b6f1c88---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Erlang Central - Medium</title>
            <link>https://medium.com/erlang-central?source=rss----e9636b6f1c88---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:10:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/erlang-central" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Erlang Quick Install]]></title>
            <link>https://medium.com/erlang-central/erlang-quick-install-9c5dcaa5b634?source=rss----e9636b6f1c88---4</link>
            <guid isPermaLink="false">https://medium.com/p/9c5dcaa5b634</guid>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[erlang]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Erlang Central]]></dc:creator>
            <pubDate>Mon, 25 Jul 2016 14:40:57 GMT</pubDate>
            <atom:updated>2016-07-25T14:41:07.553Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*kN9zqKv4UExxpvZhhNJc4g.png" /></figure><p>Before you can play around with Erlang, you’ll need to get it installed. There is a <a href="http://www.erlang.org/doc/installation_guide/INSTALL.html">complete installation guide</a> that covers all the configurations. This guide will give you a simple, minimal installation that will get your first Erlang shell running in no time.</p><ul><li>Install Erlang on Mac OS X</li><li>Install Erlang on Linux</li><li>Install Erlang on Windows</li><li>Precompile package with latest versions</li><li>Compiling Erlang from source</li></ul><h3>Install Erlang on Mac OS X</h3><p>Using Homebrew:</p><pre>brew install erlang</pre><p>Using MacPorts:</p><pre>sudo port install erlang</pre><h3>Install Erlang on Linux</h3><p>Most operating systems have pre-built Erlang distributions in their package management systems.</p><h4>For Ubuntu/Debian:</h4><pre>sudo apt-get update<br>sudo apt-get install erlang</pre><h4>For Fedora:</h4><pre>sudo yum install erlang</pre><h4>For FreeBSD</h4><pre>sudo pkg update<br>sudo pkg install erlang</pre><h3>Install Erlang on Windows</h3><p><a href="http://www.erlang.org/download.html">Download the Window installer</a></p><h3>Precompile package with latest versions</h3><p>Looking for the latest stable release or a previous Erlang version? <a href="https://www.erlang-solutions.com/">Erlang Solutions</a> provides a <a href="https://www.erlang-solutions.com/downloads/download-erlang-otp">precompiled installation package</a> for OS X, Windows, Ubuntu, Debian, Fedora, CentOS, Raspbian and other platforms. They also provide an enterprise Erlang distribution.</p><p><a href="https://www.erlang-solutions.com/resources/download.html">Download from Erlang Solutions</a></p><h3>Compiling Erlang from source</h3><p>You can build Erlang from source on your own, using the <a href="https://github.com/yrashk/kerl">Kerl</a> script. Kerl is a script that lets you easily build different versions of Erlang with a few commands.</p><p>Download Kerl:</p><pre>curl -O <a href="https://raw.githubusercontent.com/spawngrid/kerl/master/kerl">https://raw.githubusercontent.com/spawngrid/kerl/master/kerl</a><br>chmod +x kerl</pre><p>Choose an available Erlang source release and build it like this (in this case we choose 18.0 and name it <em>mybuild-18.0</em>):</p><pre>./kerl list releases<br>./kerl build 18.0 <em>mybuild-18.0</em></pre><p>Choose a directory to install, for example <em>~/erlang-r16b03</em></p><pre>./kerl list builds<br>./kerl install <em>mybuild-18.0</em> <em>~/erlang-18.0</em></pre><p>Finally, add the directory <em>~/erlang-18.0/bin</em> to your environment variable $PATH.</p><pre>export PATH=$PATH:<em>~/erlang-18.0/bin</em></pre><h3>Done!</h3><p>Run <em>erl</em> in your terminal to start an Erlang shell:</p><pre>$ erl<br>Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]</pre><pre>Eshell V7.0  (abort with ^G)<br>1&gt;</pre><p><a href="https://medium.com/@ErlangCentral/building-your-first-erlang-app-using-rebar3-25f40b109aad#.ny50utbps"><strong>Next Step: Building Your First Erlang App with Rebar3</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c5dcaa5b634" width="1" height="1" alt=""><hr><p><a href="https://medium.com/erlang-central/erlang-quick-install-9c5dcaa5b634">Erlang Quick Install</a> was originally published in <a href="https://medium.com/erlang-central">Erlang Central</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Your First Erlang App Using Rebar3]]></title>
            <link>https://medium.com/erlang-central/building-your-first-erlang-app-using-rebar3-25f40b109aad?source=rss----e9636b6f1c88---4</link>
            <guid isPermaLink="false">https://medium.com/p/25f40b109aad</guid>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[rebar3]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[erlang]]></category>
            <dc:creator><![CDATA[Erlang Central]]></dc:creator>
            <pubDate>Mon, 25 Jul 2016 14:39:26 GMT</pubDate>
            <atom:updated>2016-07-25T14:40:06.822Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*JlBXyhetO3W0m9NgO20KbQ.png" /><figcaption>Image: <a href="http://www.rebar3.org/">http://www.rebar3.org/</a></figcaption></figure><p>Rebar3 is a build tool and package management tool for Erlang. Creating and publishing your Erlang packages is simple thanks to <a href="http://www.rebar3.org/">Rebar3</a> with its plugin to <a href="https://hex.pm/">Hex</a>. Let’s make a simple “hello world” package, and feel free to play along at home!</p><h3>Download Rebar3</h3><p>Download the latest version here: <a href="http://www.rebar3.org/">http://www.rebar3.org/</a>.</p><pre>curl -O <a href="https://s3.amazonaws.com/rebar3/rebar3">https://s3.amazonaws.com/rebar3/rebar3</a></pre><p>Use chmod to make it executable, then add it to your environment variable PATH.</p><pre>chmod +x rebar3<br>export PATH=$PATH:your-current-directory</pre><h3>Your first Erlang app</h3><p>Start with the command <em>rebar3 new</em> to generate a new project from the built-in template called <em>app</em>. In this example we are creating a project called <em>myapp</em>. Other available templates are: <em>release, lib, plugin, escript, cmake</em>.</p><pre>$ rebar3 new app myapp<br>===&gt; Writing myapp/src/myapp_app.erl<br>===&gt; Writing myapp/src/myapp_sup.erl<br>===&gt; Writing myapp/src/myapp.app.src<br>===&gt; Writing myapp/rebar.config<br>===&gt; Writing myapp/.gitignore<br>===&gt; Writing myapp/LICENSE<br>===&gt; Writing myapp/README.md</pre><p>Code for your package is placed within the <em>src</em> directory.</p><pre>$ cd myapp<br>$ tree<br>.<br>├── LICENSE<br>├── README.md<br>├── rebar.config<br>└── src<br>    ├── myapp.app.src<br>    ├── myapp_app.erl<br>    └── myapp_sup.erl</pre><p>The convention is to have one <em>.app.src</em> file to define your app as an OTP application, since Rebar3 only handles <a href="http://www.erlang.org/doc/design_principles/applications.html">OTP structured projects</a>. Looks familiar? The file is also Erlang. Check out the full <a href="http://www.erlang.org/doc/design_principles/applications.html#id73836">reference</a> to see what it can contain.</p><pre>$ cat src/myapp.app.src <br>{application, &#39;myapp&#39;,<br> [{description, &quot;An OTP application&quot;},<br>  {vsn, &quot;0.1.0&quot;},<br>  {registered, []},<br>  {mod, {&#39;myapp_app&#39;, []}},<br>  {applications,<br>   [kernel,<br>    stdlib<br>   ]},<br>  {env,[]},<br>  {modules, []}<br> ]}.</pre><p>The code inside of <em>src/myapp_app.erl</em> is pretty bare bones. It just makes sure that you can start and stop your Erlang app:</p><pre>$ cat src/myapp_app.erl <br>-module(&#39;myapp_app&#39;).<br>-behaviour(application).<br>-export([start/2, stop/1]).</pre><pre>start(_StartType, _StartArgs) -&gt;<br>    &#39;myapp_sup&#39;:start_link().</pre><pre>stop(_State) -&gt;<br>    ok.</pre><p>Rebar3 uses a file called <em>rebar.config</em> to specify addition metadata, such as <a href="https://github.com/rebar/rebar/wiki/Dependency-management">dependencies</a>. There are lots of fields <em>rebar.config</em> can contain. To see them all check out the <a href="https://github.com/rebar/rebar/blob/master/rebar.config.sample">full sample</a>.</p><pre>$ cat rebar.config <br>{erl_opts, [debug_info]}.<br>{deps, []}.</pre><p>Now let’s use Rebar3 to start an Erlang shell with your app and the dependencies in the path. Run <em>application:start(myapp).</em> to verify that your app is correctly loaded.</p><pre>$ rebar3 shell<br>===&gt; Verifying dependencies...<br>===&gt; Compiling myapp<br>Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false]</pre><pre>Eshell V5.10.4  (abort with ^G)<br>1&gt; application:start(myapp).<br>ok<br>2&gt; application:stop(myapp). <br>ok<br>3&gt; <br>=INFO REPORT==== 29-Jun-2015::16:14:10 ===<br>    application: myapp<br>    exited: stopped<br>    type: temporary</pre><p>To learn about the command <em>rebar3 shell</em>, <a href="https://github.com/ferd">Fred Hebert</a> (author of <a href="http://learnyousomeerlang.com/">Learn You Some Erlang</a>) wrote a nice post about it <a href="http://ferd.ca/rebar3-shell.html">here</a>.</p><h3>Erlang Packages</h3><h3>Before you start</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Qv6ykhxvKsU6yfMkrShYxA.png" /><figcaption>Image: hex.pm</figcaption></figure><p>We need to install a plugin called <a href="https://github.com/hexpm/rebar3_hex"><em>rebar3_hex</em></a> in order to use fetch and install Erlang packages from <a href="https://hex.pm/">Hex.pm</a>, the Erlang/Elixir package manager. Simply add the following line to your <em>rebar.config</em> file. (You need Erlang version OTP 17.4 and above)</p><pre>{plugins, [rebar3_hex]}.</pre><p>Then run the commend: <em>rebar3 update </em>to enable the plugin.</p><pre>$ rebar3 update<br>===&gt; Fetching jsx ({pkg,&lt;&lt;&quot;jsx&quot;&gt;&gt;,&lt;&lt;&quot;2.6.1&quot;&gt;&gt;})<br>===&gt; Fetching ssl_verify_hostname ({pkg,&lt;&lt;&quot;ssl_verify_hostname&quot;&gt;&gt;,<br>                                           &lt;&lt;&quot;1.0.5&quot;&gt;&gt;})<br>===&gt; Fetching rebar3_hex ({pkg,&lt;&lt;&quot;rebar3_hex&quot;&gt;&gt;,&lt;&lt;&quot;0.6.0&quot;&gt;&gt;})<br>===&gt; Compiling ssl_verify_hostname<br>===&gt; Compiling jsx<br>===&gt; Compiling rebar3_hex<br>===&gt; Updating package index...</pre><p>If you want to avoid this step every time you create a new Erlang app, add the entry to a global <em>rebar.config </em>and place it at:</p><pre>~/.config/rebar3/rebar.config</pre><h3>Finding Erlang packages</h3><p>The search command lets you find remote Erlang packages published on <a href="https://hex.pm/">Hex.pm</a>. You can use regular expression characters in your query:</p><pre>$ rebar3 hex search cowboy<br>cloudi_service_http_cowboy<br>cowboy</pre><h3>Installing packages</h3><p>Rebar3 can download and install the Erlang packages and any necessary dependencies. Add the application names to the <em>deps</em> entry in your <em>rebar.config</em> file, then run the command: <em>rebar3 compile. </em>In this example we are trying to use two Erlang packages called <em>cowboy</em> and <em>meck</em>.</p><pre>{deps, [cowboy, meck]}.</pre><pre>$ rebar3 compile<br>===&gt; Verifying dependencies...<br>===&gt; Fetching ranch ({pkg,&lt;&lt;&quot;ranch&quot;&gt;&gt;,&lt;&lt;&quot;1.0.0&quot;&gt;&gt;})<br>===&gt; Fetching meck ({pkg,&lt;&lt;&quot;meck&quot;&gt;&gt;,&lt;&lt;&quot;0.8.2&quot;&gt;&gt;})<br>===&gt; Fetching cowlib ({pkg,&lt;&lt;&quot;cowlib&quot;&gt;&gt;,&lt;&lt;&quot;1.0.1&quot;&gt;&gt;})<br>===&gt; Fetching cowboy ({pkg,&lt;&lt;&quot;cowboy&quot;&gt;&gt;,&lt;&lt;&quot;1.0.0&quot;&gt;&gt;})<br>===&gt; Compiling cowlib<br>===&gt; Compiling ranch<br>===&gt; Compiling meck<br>===&gt; Compiling cowboy<br>===&gt; Compiling myapp</pre><p>Want to install a specific version of an Erlang package? Write the application name and the version in a tuple. You can browse the available versions of a package at <a href="https://hex.pm/">Hex home page</a>.</p><pre>{deps, [{cowboy, “1.0.2”}, {meck, &quot;0.8.3&quot;}]}.</pre><h3>Listing Installed packages</h3><p>The <em>rebar3 deps</em> command shows your locally installed packages:</p><pre>$ rebar3 deps<br>cowboy (locked package 1.0.0)<br>meck (locked package 0.8.2)</pre><h3>Uninstalling packages</h3><p>To uninstall a package, you have to remove it from the <em>rebar.config</em> file first, then use the command: <em>rebar3 unlock</em>. Here we removed the package <em>meck </em>from our list.</p><pre>$ rebar3 unlock<br>$ rebar3 deps<br>cowboy (locked package 1.0.0)</pre><h3>Further Reading</h3><p><a href="http://www.rebar3.org/">http://www.rebar3.org/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25f40b109aad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/erlang-central/building-your-first-erlang-app-using-rebar3-25f40b109aad">Building Your First Erlang App Using Rebar3</a> was originally published in <a href="https://medium.com/erlang-central">Erlang Central</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>