Skip to content

Complete Development Installation

Luke Baker edited this page Sep 18, 2015 · 3 revisions

If you haven’t completed the Installing instructions do, complete those first.

Set up the mysql database

Open config/database.yml in the allourideas.org directory and edit the development block in the file, making sure the user (perhaps root) has access. I added the lines:

host: localhost
username: root
password: my_password

Create the database with ./bin/rake db:create and then ./bin/rake db:schema:load

Start the server

bundle exec ruby ./script/server -p 3001

At this point, you should be able to see a rendered version of the front page by visiting http://localhost:3001. If you try to create a question, it will probably error due to not having permission to access the pairwise API.

Create an authorized ‘allourideas’ user on the pairwise site.

Since the pairwise api server authenticates each request we make to it, we’ll need to create an allourideas user and photocracy user on the pairwise site. These commands should be run on your install of the pairwise API.

cd ../pairwise-api
./bin/rake util:useradd[[email protected],wheatthins]
./bin/rake util:useradd[[email protected],saltines]

Add entry to local hosts file

To trigger photocracy, the code checks for the string “photocracy” in the URL. What I’ve done is added an entry to my /etc/hosts file:

0.0.0.0 photocracy

This allows you to visit http://photocracy:3001/.

At this point, you should be able to navigate to http://localhost:3001/questions/new and create your own question. Once you’ve created a question, verify that voting and other site functionality work as expected.

Start Delayed Job Workers

If you want to enable the export results as CSV feature, you’ll need a delayed_job worker for All Our Ideas code and pairwise. For development, you can use ./bin/rake jobs:work