Running Multiple Rails Applications with Pow

Pow is a zero-config Rack server for Mac OS X created by 37signals which “makes developing Rails and Rack applications as frictionless as possible.” I just discovered Pow thanks to overhearing Patrick Bacon discuss his setup for working on multiple Rails applications at the same time.

Pow allows me to have more than one Rails application running at a time on my development machine and keeps the browser history sandboxed for each application, making auto completion in the browser’s address bar much more useful.

Getting rolling with 37signal’s Pow is easy, just follow the simple commands from their Github page or from the homepage on Pow’s website.

Once you have Pow installed, just start creating symlinks to your Rack-based web applications. Here is my ~/.pow directory.

└── .pow
    ├── default -> /Users/greg/git/ddot/ddot
    ├── ddot -> /Users/greg/git/ddot/ddot
    ├── aotools -> /Users/greg/git/aotools
    └── kidtelligent -> /Users/greg/git/kidtelligent

In order to visit all your Rails applications from an external device utilizing Pow, you first need to have a hostname that resolves to your computer’s IP address. Second you need to configure Pow to recognize your external domain by exporting an environment variable called POW_EXT_DOMAINS with your hostname. I had an entry added to our DNS Server so gpat.atomicobject.localnet resolved to port 80 on my computer. I then created a ~/.powconfig file in my home directory that Pow loads on startup to setup the required environment variable. Once configured correctly, I can now visit the applications listed in my ~/.pow from a different computer or iPad on our network. For example, locally I would visit a symlinked application with the name “kidtelligent” using http://kidtelligent.dev/; remotely I could visit the same application using http://kidtelligent.gpat.atomicobject.localnet/.

export POW_EXT_DOMAINS=gpat.atomicobject.localnet
export POW_TIMEOUT=28800

I’ve been using Pow for a couple weeks now and have been happy with the improvement to my development workflow. There are some third party tools available for Pow to further simplify its usage (it that is even possible?) listed at the bottom of Pow’s user manual, but I found just adding the following aliases met my needs.

alias al="tail -f log/development.log"
alias restart="touch tmp/restart.txt"

Give Pow a try. It takes less time to get it working than reading this blog post.