2

I'm using CentOS 7 with Vagrant to work on my rails application and I was under the impression that I could just CTRL + c to restart my rails server and see any changes I've made to the view, but it looks like I have to exit the vm and 'vagrant reload' every time I make a change. Am I understanding this correctly, is this what I have to do each time I make a change in order for it to apply? Shouldn't I only have to restart the rails server each time I make a change?

This is how my Vagrant file is currently set up:

config.vm.box = "centos/7"
  config.vm.network "forwarded_port", guest: 3000, host: 3000
  config.vm.provision :shell, path: "bootstrap.sh", privileged: false
  config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--memory", "2048"]
    vb.customize ["modifyvm", :id, "--cpus", "2"]
    vb.customize ["guestproperty", "set", :id, "--timesync-threshold", 5000]
  end
end
Zestyyy
  • 27
  • 4

1 Answers1

1

This VM has the shared folder setup to run as rsync mode, you can review that from the Vagrantfile box file:

Vagrant.configure("2") do |config|
  config.vm.base_mac = "5254001fdbb7"
  config.vm.synced_folder ".", "/vagrant", type: "rsync"
end

You can learn more about vagrant and rsync by reading the doc https://www.vagrantup.com/docs/synced-folders/rsync.html.

Vagrant has a command line https://www.vagrantup.com/docs/cli/rsync-auto.html so you can run vagrant rsync-auto and the changes will be in sync from the host to the VM

Frederic Henri
  • 51,761
  • 10
  • 113
  • 139