- You need to set up a local database. Any of the databases supported by Rails will work, but PostgreSQL is recommended.
- Some tutorials are here and here. If you're on a mac, use Heroku's Postgres.app
- Make a copy of the
database.yml.sample
provided (in theconfig
directory); name itdatabase.yml
- Fill in the details for your database.
For example, the database.yml
will look something like this if you're using Postgres.app:
development:
adapter: postgresql
encoding: unicode
database: user_service_development
pool: 5
username:
password:
test:
adapter: postgresql
encoding: unicode
database: user_service_test
pool: 5
username:
password:
production:
adapter: postgresql
encoding: unicode
database: user_service_production
pool: 5
username:
password:
- Navigate to the survey-web directory from a terminal.
- Type
rails server
- If the server starts up without complaining, your database is set up correctly.
- To install all the libraries required by this application, navigate to the survey-web directory from a terminal.
- Type
gem install bundler
and thenbundle install
- Create an super_admin user for user-owner by running the following. This step is required.
$ rake db:super_admin
- You can generate a CSO Admin and a Field agent as well by running the following. This is optional.
$ rake db:users
- You will now have the following users set up:
CSO Admin: {email: "cso_admin@admin.com", password: "cso_admin"}
Field Agent: {email: "field_agent@admin.com", password: "field_agent"}
- These users belong to My Organization
- Start the survey-web app by typing
rails server
from the console. - Use
rails server -p 3001
if a client app is running on the default port3000
.