Skip to content

Instantly share code, notes, and snippets.

@kylewelsby
Created September 25, 2013 12:02
Show Gist options
  • Save kylewelsby/6698682 to your computer and use it in GitHub Desktop.
Save kylewelsby/6698682 to your computer and use it in GitHub Desktop.
prepare rails application with ProstgreSQL and Redis
#!/bin/bash -e
cp config/database.yml.example config/database.yml
# bundle install
postgres -D /usr/local/var/postgres > /dev/null 2>&1 &
POSTGRES_PID=$!
redis-server > /dev/null 2>&1 &
REDIS_PID=$!
bundle exec rake db:create db:schema:load --trace
echo "Shutting down PostgreSQL ($POSTGRES_PID) and Redis ($REDIS_PID)"
kill $POSTGRES_PID
kill $REDIS_PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment