App for publishers.brave.com.
- Ruby 2.3.3. For a Ruby version manager try rbenv.
- Postgresql 9.5+:
brew install postgresql
(start withbrew services start postgresql
) - Redis:
brew install redis
- Install ruby gems foreman and mailcatcher:
gem install bundler foreman mailcatcher
- Install project dependencies:
bundle install --jobs=$(nproc)
- Possible error: Nokogiri, with libxml2. Try installing a system libxml2 with
brew install libxml2
and thenbundle config build.nokogiri --use-system-libraries
then againbundle install
.
- Create and initialize the database
rails db:create RAILS_ENV=development
rails db:migrate RAILS_ENV=development
-
Start Postgres and redis.
-
Run Rails server and async worker
foreman start
-
Visit http://localhost:3000
-
To test email, run a local mail server at localhost:25
mailcatcher
Configuration is set in config/secrets.yml via environment variables.
It might be useful to maintain a local bash script with a list of env vars. For an example see config/secrets.yml.
Some variables are set automagically with Heroku addons:
- FIXIE_URL - Proxy provider. For outbound API requests.
- MAILGUN_* - For sending emails.
- NEW_RELIC_APP_NAME, NEW_RELIC_LICENSE_KEY - New Relic app monitoring.
- REDIS_URL - For Sidekiq and rack-attack
A few variables are not configured in secrets.yml:
- GPG_PUBKEY - GPG pubkey for encrypting legal forms before uploading to S3.
- Check for gem vulnerabilities:
bundle exec bundle-audit check --update