Skip to content
Jeremy Cimafonte edited this page Sep 8, 2013 · 4 revisions

Dependencies not included in this wiki - rails 4.0.0, ruby 2.0.0

1. Get the code!

$ git clone [email protected]:hkapps/ocarina.git

2. Install Postgres

Version 9.1.1 or later. Get it through Homebrew.

When it's done installing, make sure to run this:

$ initdb /usr/local/var/postgres

If you want the daemon to running whenever you boot up (YOU DO), run this:

$ mkdir -p ~/Library/LaunchAgents

# Note - postgres version and .plist file name may vary
$ cp /usr/local/Cellar/postgresql/9.1.3/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/

$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

3. Start Postgres. These are some handy aliases:

alias pgstart='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias pgstop='pg_ctl -D /usr/local/var/postgres stop -s -m fast'

Source your .bashrc and run pgstart

[Note: If you're having issues starting the database (you pgstart and calling createdb still says there's no DB running), it means /usr/local/bin is not sourced above /usr/bin in your .bashrc. Fix this before continuing.]

Create an empty database called ocarina-development and go into it.

$ createdb ocarina_development
$ psql ocarina_development

Now create a user named ocarina.

ocarina_development=# CREATE USER ocarina WITH PASSWORD '';
ocarina_development=# GRANT ALL PRIVILEGES ON DATABASE ocarina_development to ocarina;
\q

4. Setup your environment

Create a .env file

$ touch .env

Add this to your .env file:

SIDEKIQ_CONCURRENCY = 25
RACK_ENV = development
PORT = 4400

Create a application.yml file:

$ touch config/application.yml

Add this to your application.yml file:

FACEBOOK_APP_ID: "160916744087752"
FACEBOOK_APP_SECRET: "ac6283133dbfcd2450aa0fa35568d00b"
DROPBOX_APP_KEY: "8gpo81hnkpe0mcd"
DROPBOX_APP_SECRET: "9o5zvrzrq2u9xb6"
PUSHER_APP_ID: "50589"
PUSHER_KEY: "e9eb3f912d37215f7804"
PUSHER_SECRET: "4e47a472557c3320f2b3"

Run bundle

$ bundle

Migrate the database

$ bundle exec rake db:migrate

Start the server

$ foreman start

Head to http://localhost:4400/