Skip to content

Instantly share code, notes, and snippets.

@stevenyap
Created February 21, 2014 08:43
Show Gist options
  • Save stevenyap/9130790 to your computer and use it in GitHub Desktop.
Save stevenyap/9130790 to your computer and use it in GitHub Desktop.
POW deployment server

This allows you to access the development server of your app without starting rails server. This means you can access multiple development site at the same time. Useful if you have an API app and another app to work together with.

Setup

# install
curl get.pow.cx | sh

# set links to your app
cd ~/.pow
ln -s ~/Workspace/project project

# setup RVM linkage
cd ~/Workspace/project
touch .powrc
# Copy and paste the below .powrc into your .powrc which loads your RVM and gemset

# no need to restart anything
# now you can access the site at http://project.dev
# You need to enter http:// in Chrome

.powrc

if [ -f "$rvm_path/scripts/rvm" ]; then
  source "$rvm_path/scripts/rvm"
 
  if [ -f ".rvmrc" ]; then
    source ".rvmrc"
  fi
 
  if [ -f ".ruby-version" ]; then
    rvm use `cat .ruby-version`
  fi
 
  if [ -f ".ruby-gemset" ]; then
    rvm gemset use --create `cat .ruby-gemset`
  fi
fi

Others

  • To access your site from other computers (eg. VirtualBox), use http://project.10.0.2.2.xip.io/
  • To access your site from GenyMotion, use 'http://project.192.168.56.1.xip.io'
  • To restart app, touch tmp/restart.txt

Trouble-shooting

  • If you have GEM json outdated issue, try bundle update json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment