Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vagrant 错误:符号链接没有引用_Vagrant_Virtualbox_Symlink_Environment_Synced Folder - Fatal编程技术网

Vagrant 错误:符号链接没有引用

Vagrant 错误:符号链接没有引用,vagrant,virtualbox,symlink,environment,synced-folder,Vagrant,Virtualbox,Symlink,Environment,Synced Folder,我正在与旧的bug/错误作斗争,我列出了许多可能的解决方案,但对我来说没有结果。 我有一个虚拟盒子和文件: Vagrant.configure("2") do |config| config.vm.box = "debian/jessie64" config.vm.network "private_network", ip: "192.168.56.101" config.vm.synced_folder "../mysite.local", "/code/mysite.local"

我正在与旧的bug/错误作斗争,我列出了许多可能的解决方案,但对我来说没有结果。 我有一个虚拟盒子和文件:

Vagrant.configure("2") do |config|
  config.vm.box = "debian/jessie64"
  config.vm.network "private_network", ip: "192.168.56.101"
  config.vm.synced_folder "../mysite.local", "/code/mysite.local", type: "virtualbox"
  config.vm.provider "virtualbox" do |vb|
  vb.memory = "2048"
  end
end
在我创建符号链接文件夹之前,一切正常。因此,当我键入
vagrant up
时,它会抛出一个错误:

==> default: Checking if box 'debian/jessie64' is up to date...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
[default] GuestAdditions 5.1.31 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Rsyncing folder: /Users/user/code/sandbox/mysite.local/ => /vagrant
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /Users/user/code/sandbox/mysite.local/
Guest path: /vagrant
Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2222 -o LogLevel=FATAL  -o ControlMaster=auto -o ControlPath=/var/folders/kh/sp8l6c0d1s3_jqkv6cv2jzlw0000gn/T/ssh.832 -o ControlPersist=10m  -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/Users/user/code/sandbox/mysite.local/.vagrant/machines/default/virtualbox/private_key'" "--exclude" ".vagrant/" "/Users/user/code/sandbox/mysite.local/" "vagrant@127.0.0.1:/vagrant"
Error: symlink has no referent: 
"/Users/user/code/sandbox/mysite.local/web"
rsync error: some files could not be transferred (code 23) at 
/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-
52/rsync/main.c(996) [sender=2.6.9]

我需要做什么来修复该问题?

您的符号链接/Users/user/code/sandbox/mysite.local/web已损坏,因此rsync无法将其复制到您的VM。在您运行Wagrant之前,请修复您的符号链接或将其移开:

cd /Users/user/code/sandbox/mysite.local
mv  web ../

因此,删除断开的链接并不是解决该问题的最佳方案。默认情况下,“主”同步目录为/vagrant。我还制作了另一个同步文件夹。这是他们之间的冲突

config.vm.synced_folder ".", "/vagrant", disabled: true

将这些行添加到我的vagrant文件后,错误消失。

Hvae您尝试过:vagrant插件安装vagrant vbguest