Running erlang on heroku

Update: Kristian Kristensen writes on how to run webmachine on heroku.

With heroku’s new celadon cedar stack, you can run ruby, node.js, logo, and clojure. Since Heroku uses erlang it in their routing mesh, they may have erlang installations accessible from the slugs themselves.

Let’s try it out with beepbeep.

~ $ cd projects
~ $ git clone https://github.com/davebryson/beepbeep.git
~ $ cd beepbeep

create and build a new app.

beepbeep (master) $ make && ./script/new_beep.erl adf adf
beepbeep (master) $ vi adf/adf/src/home_controller.erl
beepbeep (master) $ vi adf/adf/views/base.html
beepbeep (master) $ vi adf/adf/src/adf_sup.erl # change the port
beepbeep (master) $ cd adf/adf && make

add a Procfile at the top of the project

web: exec erl -pa adf/adf/ebin/ deps/*/ebin -boot start_sasl -s adf

add a Gemfile to make sure you’ve got the heroku gem available

source 'http://rubygems.org'
gem 'heroku'

beepbeep (master *) $ bundle

add the whole thing to git

beepbeep (master *) $ git add .
beepbeep (master *) $ git commit -m"herokufy"

give it some heroku love

beepbeep (master *) $ heroku create async-dream-feet --stack cedar
beepbeep (master *) $ git push heroku master
beepbeep (master *) $ heroku ps

And voila! a crashed erlang vm. It looks like startup goes fine but something kills the actual application. This merits further investigation.

06/03/11 at 3:42pm
| View comments