run_unicorn.md 917 Bytes

Some notes about unicorn

First off, it only servers the rails application, not the static assets. You need to have another webserver for this.

SECRET_KEY

By default rails reads the secret key from the environment variable SECRET_KEY_BASE. It is possible to create a key with rake secret

Start unicorn

SECRET_KEY_BASE="fa27f9d1cdfeb8590377366cb89c973b6084a20b60a4e60b551563cb1119156a0f172212f54fc096e182bf5310b6ca8cb050814c5908c8523cb191d1a054ca29" bundle exec unicorn -c config/unicorn.rb -E production

Precompile assets

RAILS_ENV=production bundle exec rake assets:precompile

Urls