LoginSignup
2
5

More than 5 years have passed since last update.

Vagrant up で rsync のエラーが出てしまう現象.

Last updated at Posted at 2015-11-25

現象が起きた環境

OS
Windows 7
rsync
rsync version 3.1.0 protocol version 31
Vagrant
Installed Version: 1.7.4
Cygwin
Cygwin for 64-bit versions of Windows
Client
mintty 2.1.5 (x86_64-pc-cygwin)

前提・現象

Vagrant に手を出してみようと思ってセットアップ後、初めて vagrant up したときに以下のようなエラーが出た.

Host path: /c/vagrant_root/
Guest path: /home/vagrant/sync
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 IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'C:/vagrant_root/.vagrant/machines/default/virtualbox/private_key' --exclude .vagrant/ /c/vagrant_root/ vagrant@127.0.0.1:/home/vagrant/sync
Error: Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
rsync: change_dir "/c/vagrant_root" failed: No such file or directory (2)
FATAL I/O ERROR: dying to avoid a --delete-during issue with a pre-3.0.7 receiver.
rsync error: requested action not supported (code 4) at flist.c(1882) [sender=3.1.0]

なんか…

rsyncchange_dir したときのパス、おかしくない?

/c/vagrant_root

なんて場所ないよね、そりゃそうだ.
どうやら cygwin でのパス解決ができてないっぽい?

解決方法

https://github.com/mitchellh/vagrant/blob/master/plugins/synced_folders/rsync/helper.rb#L48
(実際にインストールされる場所は C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.5.1\plugins\synced_folders\rsync\helper.rb だと思う.)

上記箇所を以下のようにする.

hostpath = "/cygdrive" + Vagrant::Util::Platform.cygwin_path(hostpath)

コードに修正を入れてしまうのはちょっと気が引けるが…

別件でどうしても Cygwin を使いたいのでこれで我慢することに.

ひとまずエラーもなくなったので解決!

それでは良きエンジニアライフを(^w^)ノシ

2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5