From 1f2d098541ec723f541e3d8bfad29ade7386397b Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Tue, 18 Sep 2018 12:12:29 +0200 Subject: [PATCH] Fix Vagrant's Hot Reloading issues in development Signed-off-by: Sebastian Serth --- config/environments/development.rb | 6 ++++-- config/puma.rb | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 7bd31651..a9a24017 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -69,6 +69,8 @@ Rails.application.configure do BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP'] # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. - config.file_watcher = ActiveSupport::EventedFileUpdateChecker + # routes, locales, etc. This feature depends on the listen gem and might not + # work within a Vagrant environment. + # config.file_watcher = ActiveSupport::EventedFileUpdateChecker + config.file_watcher = ActiveSupport::FileUpdateChecker end diff --git a/config/puma.rb b/config/puma.rb index a5eccf81..250c9bd3 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -21,14 +21,14 @@ environment ENV.fetch("RAILS_ENV") { "development" } # Workers do not work on JRuby or Windows (both of which do not support # processes). # -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } +workers ENV.fetch("WEB_CONCURRENCY") { 2 } # Use the `preload_app!` method when specifying a `workers` number. # This directive tells Puma to first boot the application and load code # before forking the application. This takes advantage of Copy On Write # process behavior so workers use less memory. # -# preload_app! +preload_app! # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart