Skip to content

Latest commit

 

History

History
88 lines (44 loc) · 2.96 KB

README.rdoc

File metadata and controls

88 lines (44 loc) · 2.96 KB

README

  • Homebrew

Homebrew automates installing UNIX packages on Mac OS X, and is recommended for installing other dependencies of this project.

mxcl.github.com/homebrew/

  • Postgres

Install postgres 9.1.x using Homebrew:

$ brew install postgres

Modify your postgresql.conf to enable prepared transactions:

max_prepared_transactions = 4

Make sure to also create the data25c database and schema, see the data25c project README.

You can install the auto-launch config, or manually start and stop postgres on the command line. If you forget the commands, you can get the info at any time:

$ brew info postgres

The postgres info includes the command to initialize your db for the first time:

$ initdb /usr/local/var/postgres

This creates a default ‘postgres’ database. The project is then configured to use a shared ‘superuser’ account role for accessing and managing the dbs for this (and other) 25c project. To create this role, open a psql command line client:

$ psql postgres

This should open the client, connected to the default postgres database. In the tool, execute the following command:

postgres=# CREATE ROLE superuser WITH SUPERUSER LOGIN;

Once created, you should be able to run the rake task to create the development database:

$ rake db:setup

  • Redis

Install redis using Homebrew:

$ brew install redis

You can install the auto-launch config, or manually start and stop redis on the command line. For instructions:

$ brew info redis

  • ImageMagick

Install imagemagick using Homebrew (dependency for rmagick, for image scaling)

$ brew install imagemagick

  • Asset Precompilation on Heroku

The app on Heroku must have the user-env-compile labs feature enabled for asset precompilation to work, as some assets refer to variables initialized in the user config.

heroku labs:enable user-env-compile

devcenter.heroku.com/articles/labs-user-env-compile

  • Resque

Resque is a background job queue implementation. Process background jobs by running a resque worker:

$ rake resque:work

  • Email

ActionMailer has now been configured to dispatch email in a background process using Resque. You need to have a worker running to process the queue in order to test email delivery (see above). In the development environment, the recipient will be overridden with an email address set in the MAILTO environment variable. This allows you to test sending email to different addresses, but receive them all in a single account. You can specify this in your environment, or on the command line when starting the resque worker (since email is sent only in the background worker process):

$ rake resque:work MAILTO=<email address here>

  • Starting everything up

Make sure postgres and redis are running- check the brew info postgres and brew info redis documentation for commands, such as this:

$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

$ redis-server /usr/local/etc/redis.conf

Then run the rails server in the root of the project folder:

$ rails s