Restart your Heroku application based on Heroku errors (e.g R14) indicating the app is in dire need of a restart.
Variable | Comment |
---|---|
AIRBRAKE_PROJECT_ID | Used in config/initializers/airbrake.rb |
AIRBRAKE_API_KEY | Used in config/initializers/airbrake.rb |
BLOCK_HTTP_TRACE | Disables HTTP TRACE method if set to true/t/1 |
BUNDLE_GEMFILE | Useful when using a Gemfile.dev |
DATABASE_URL | Used for production env, automatically set by Heroku |
GOOGLE_ANALYTICS_ID | Will be added to the main application layout if set |
HOST | Your base URI, e.g. https://myapp.herokuapp.com |
NEW_RELIC_APP_NAME | Used in config/newrelic.yml |
NEW_RELIC_LICENSE_KEY | Used in config/newrelic.yml |
PORT | Port Puma will listen on, defaults to 3000 |
RAILS_LOG_TO_STDOUT | Set by Heroku Ruby buildpack, set manually on other platforms if needed |
RAILS_MAX_THREADS | Number of Puma threads, defaults to 5 |
REDIS_URL | Used in config/cable.yml |
WEB_CONCURRENCY | Number of Puma workers. We default to threads only, no workers |
All of the following have been installed and pre-configured:
- Rails 5.2.0
- Ruby 2.5.1
- pg for
ActiveRecord
All of these are managed by yarn
.
- Brakeman
- bullet
- letter_opener
- memory_profiler
- newrelic_rpm
- nullalign
- pry
- pry-byebug
- pry-doc
- rack-mini-profiler
- RuboCop
Rspec has been preconfigured for Rails 5.1+ system tests.
- No need to
require 'rails_helper
, we do it in.rspec
- bundler-audit (runs on CircleCI)
- capybara
- factory_bot_rails
- shoulda-matchers
- spring-commands-rspec
- webmock
The following default Rails gems have been removed:
By default ES6 will not work for files in app/assets/javascript
since Uglifier will fail to
process them. This is why we applied the following change to config/production.rb
, which allows
you to use ES6 project wide:
- config.assets.js_compressor = :uglifier
+ config.assets.js_compressor = Uglifier.new(harmony: true)
Also note that for everything to work properly on Heroku, you need to set up your buildpacks like this:
heroku buildpacks:clear
heroku buildpacks:set heroku/nodejs
heroku buildpacks:add heroku/ruby
ApplicationDecorator
: lightweight alternative to Draper or similar gems.ApplicationForm
: Minimal form class based onActiveModel
.ApplicationPresenter
: a subclass ofApplicationDecorator
for presenters, includes tag helpers.
All custom classes are fully documented with yard and come with generators.
Use yard doc
to generate documentation and yard server --reload
or yard server --gems
to start
a local documentation server.
If you want to add specific gems for development that may not be interesting for other developers,
you can add a Gemfile.dev
(ignored by our .gitignore
). Gems listed there can be installed with
bundle install --gemfile Gemfile.dev
and the resulting lock file is gitignored too.
Example Gemfile.dev
:
source 'https://rubygems.org'
eval_gemfile 'Gemfile'
gem 'awesome_print'
The eval_gemfile
line will ensure that all gems from your regular Gemfile
will be included too.
The BUNDLE_GEMFILE
variable can be used to let Bundler now which gemfile to use:
BUNDLE_GEMFILE=Gemfile.dev rails c
There's a custom middleware (Rack::RejectTrace
) for completely disabling the HTTP TRACE method as
required by certain security audits. It can be enabled via the BLOCK_HTTP_TRACE
environment
variable.
Favicons were generated with Real Favicon Generator, consider using the same tool when replacing them for your project.