Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 5 restart server every time controller or model changes

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?

like image 227
César Lourenço Avatar asked Dec 09 '16 18:12

César Lourenço


1 Answers

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
like image 149
César Lourenço Avatar answered Nov 15 '22 00:11

César Lourenço