Vagrant shared folder with rails server

I run rails in the nfs public folder in the firewall. While the server is running (thin / webrick), I am editing files on my host. But I have to keep stopping and restarting the application server to see the changes reflected in webapp. Is this normal behavior?

+1
source share
1 answer

I move on to this issue on the Vagrant box by synchronizing my folder with NFS .

I made changes to the application development configuration file ( config/environments/development.rb ) by simply adding this line config.reload_classes_only_on_change = false and it works.

Make sure you have this config.cache_classes = false , and I had it by default when I install the rails application (using version 4.1.5), because where I found this workaround ( http: // edgeguides .rubyonrails.org / configuring.html ) says config.reload_classes_only_on_chage = false ignored if config.cache_classes is true

Another solution is to use the vagrant Rsync synchronization mechanism, which is available from version 1.5 and has some advantages, but it does not work for me because I run out of space if I have to make a copy of my workspace on every virtual machine that I have.

+2
source

Source: https://habr.com/ru/post/1261067/


All Articles