Vagrant rsync不是这样的文件或目录

时间:2015-12-16 16:02:52

标签: vagrant rsync

我在Windows 7上使用vagrant 1.7.2并尝试rsync文件到Ubuntu框。 当我试图做流浪汉时,我在同步文件夹时遇到错误。我需要一个不同版本的rsync或vagrnat吗?

Vagrant 1.7.2

rsync 3.1.1

主机Windows 7

Guest Ubantu 14.04

Vagrant文​​件

config.vm.synced_folder ".", "/var/www",
              rsync__auto: true,
              type: :rsync

LOG

==> default: Rsyncing folder: /c/Development/websites/fams/ => /var/www
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /c/Development/websites/fams/
Guest path: /var/www
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i 'C:/Users/krzysztofl/.vagrant.d/boxes/cdl_vis-VAGRANTSLASH-fams/0.1.2/virtualbox/vagrant_private_key' --exclude .vagrant/ /c/Development/websites/fams/ vagrant@127.0.0.1:/var/www
Error: cygwin warning:
  MS-DOS style path detected: C:/Users/krzysztofl/.vagrant.d/boxes/cdl_vis-VAGRANTSLASH-fams/0.1.2/virtualbox/vagrant_private_key
  Preferred POSIX equivalent is: /cygdrive/c/Users/krzysztofl/.vagrant.d/boxes/cdl_vis-VAGRANTSLASH-fams/0.1.2/virtualbox/vagrant_private_key
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
rsync: change_dir "/c/Development/websites/fams" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1165) [sender=3.1.1]

1 个答案:

答案 0 :(得分:0)

您可以在Vagrantfile中添加以下内容

ENV["VAGRANT_DETECTED_OS"] = ENV["VAGRANT_DETECTED_OS"].to_s + " cygwin"

这在github issue

中有解释