Development Environment

Bootsnap

--skip-bootsnap

Reduces boot times through caching

# config/boot.rb

require 'bootsnap/setup'
# Gemfile

gem 'bootsnap', '>= 1.4.2', require: false

Listen

--skip-listen

# config/environments/development.rb

class Application < Rails::Application
  config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end
# Gemfile

group :development do
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

Spring

--skip-spring

Spring speeds up development by keeping your application running in the background.

When Spring is enabled, cache_classes should be set to false

# config/environments/test.rb

class Application < Rails::Application
  config.cache_classes = false
end
# config/spring.rb

Spring.watch(
  '.ruby-version',
  '.rbenv-vars',
  'tmp/restart.txt',
  'tmp/caching-dev.txt'
)
# Gemfile

group :development do
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

Last updated