- Install with homebrew
- Run a rails app
- Troubles I met
- More resource
pow provides local domain names (like
http://oxox.dev/). It works by injecting the following things to system:
- A local DNS server specified in
- A HTTP reverse proxy server to serve pow homepage
http://localhostand other applications
- no more
- no more editings in
- no more
- OSX only
Install with homebrew
brew install pow AND execute what you are instructed.
% brew install pow Create the required host directories: mkdir -p ~/Library/Application\ Support/Pow/Hosts ln -s ~/Library/Application\ Support/Pow/Hosts ~/.pow Setup port 80 forwarding and launchd agents: sudo pow --install-system pow --install-local Load launchd agents: sudo launchctl load -w /Library/LaunchDaemons/cx.pow.firewall.plist launchctl load -w ~/Library/LaunchAgents/cx.pow.powd.plistd.
If this succeeds, you should see a page at
Run a rails app
I have a rails app in
The following command register it in
so accesses to
http://demo_app.dev are routed to it.
The domain name is determined by name of the symlink.
% ln -s ~/demo_app ~/.pow/
Troubles I met
Error: Gem not found
Bundler::GemNotFound at first.
GEM_HOME=~/.gem is specified in .zshrc,
which is not used by pow and applications it runs.
export GEM_HOME=~/.gem to APP_ROOT/.powenv file.
Note: RVM may use more complex env for ruby and gems. They can be generated with
rvm env > APP_ROOT/.powenv
Got redirected to a search page
demo_app.dev in address bar may be redirected to search page.
Helper gem: powder
powder provides convenient commands to pow.
Restart rails app
Restart on each request (does not reload
.powenv and so on):
Use pow to host static site
Static sites can also be hosted. The static files should reside in
Use pow as a reverse proxy for non-rails app
% echo 3000 > ~/.pow/nanoc
Source: Port proxying
Allow access from other computer
So people in same LAN can access the app at
prax is an alternative for Linux. It uses:
- a daemon that runs applications
nsswitchtrick to take over routing