2

I'm running rails on a nfs shared folder in a vagrant box. While the server (thin/webrick) is running I'm editing files in my host. But I have to keep stopping and restarting the application server to see changes reflected in the webapp. Is this normal behaviour?

bobarillo
  • 173
  • 3
  • 10
  • Maybe the same issue - http://stackoverflow.com/questions/4879604/i-have-to-restart-apache-every-time-i-change-my-rails-code – Matt Cooper Jun 13 '13 at 08:50
  • @MattCooper No I think it is a different beast. It is the sync process between the host and the vagrant VM. – basgys Jun 02 '14 at 06:55

1 Answers1

2

I go this issue on Vagrant box synchronising my folder with NFS.

I made a change in my application development configuration file (config/environments/development.rb), just adding this line config.reload_classes_only_on_change = false and it works.

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

Another solution is use vagrant Rsync synchronise mechanism, which is available from version 1.5 and have some benefits, but for me it doesn't work because I run out of space if I have to make a copy of my workspace on each virtual machine that I have.

Ivan Fraixedes
  • 550
  • 3
  • 12