Skip to content

Instantly share code, notes, and snippets.

@kaosf
Last active August 29, 2015 14:05
Show Gist options
  • Save kaosf/b186cd0a9f64e99e3d4c to your computer and use it in GitHub Desktop.
Save kaosf/b186cd0a9f64e99e3d4c to your computer and use it in GitHub Desktop.
Vagrantfile for rsync Rails project between host and guest
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# ...
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.synced_folder "./path/to/rails-project", "/home/vagrant/rails-project",
type: "rsync",
owner: "vagrant",
group: "vagrant",
rsync__exclude: [".git", ".bundle", "tmp", "log", "vendor/bundle"],
rsync__chown: false
# ...
end
# Run following commands;
# vagrant init
# vagrant up
# vagrant rsync-auto
# Reference
# http://hotolab.net/blog/vagrant_rsync/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment