7

I have a vagrant box(ubuntu xenial) with my rails (5.0.0.1) development server and every time I change a model or a controller I need to restart the server.

I've tested with puma and webrick and the behavior is the same.

I do the development in my host machine which is a Windows 10 machine, vagrant creates a shared folder where I have my code.

I've checked if both the VM machine and my host are in sync in terms of time and they appear to be. Another thing that I did was to check other threads here in SO regarding similar problems but I had no luck with the suggestions given.

Does anyone have any ideas about what might be the problem?

César Lourenço
  • 629
  • 1
  • 5
  • 12

1 Answers1

14

I've resolved the problem, I stumbled upon this post Vagrant shared folder with rails server which pointed me to the right direction.

Basicallly besides having:

config.cache_classes = false

in the development.rb file it is also necessary to have:

config.reload_classes_only_on_change = false
Community
  • 1
  • 1
César Lourenço
  • 629
  • 1
  • 5
  • 12
  • 1
    [this answer](https://stackoverflow.com/a/36616931) might help as well `config.file_watcher = ActiveSupport::FileUpdateChecker` – Raju Aug 29 '17 at 06:54