Skip to content

Dev environment setup

messick edited this page Aug 3, 2016 · 6 revisions

Drive the Vote is a Rails 5 app, using:

  • a Postgres data store
  • Sidekiq/redis for asynchronous jobs
  • RSpec tests
  • Haml/Sass templates & CSS
  • Bootstrap JS/CSS framework

System

  1. Install RVM or your favorite ruby manager
  2. rvm install 2.2.5 or similar. Use 2.2.x for parity with production
  3. Install homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  4. brew install gcc redis postgres
  5. Follow homebrew instructions to auto-start redis and postgres at login.
  6. Open /etc/hosts and add the line 127.0.0.1 local.drive.vote

App

  1. Clone drive.vote
  2. cd drive.vote
  3. Set up a local .env file
  4. Install bundler: gem install bundler
  5. Bundle gems: bundle install
  6. Set up local db:
  7. Create db user: createuser -drs postgres
  8. bundle exec rake db:create
  9. bundle exec rake db:migrate
  10. Run dev server: rails s

To Send Emails in Local Dev

  1. Add following to .env file:
SEND_GRID_USER_NAME=XXX # Only required for sending emails
SEND_GRID_PASSWORD=XXX # Only required for sending emails
  1. In separate terminal, run Sidekiq: bundle exec sidekiq

TODO:

  1. How to create a local user with admin privileges
  2. Style guidelines
  3. Policy for commits, PRs, code review, etc

Clone this wiki locally