有时我会获得新创建的文件,尽管我可以在控制台中列出它们,但我无法访问这些文件。我Vagrant file
包含以下synced_folder设置:
config.vm.synced_folder "/home/ulkas/Develop/beauty/Beautyportal", "/vagrant/Beautyportal", owner: "vagrant", group: "vagrant", :mount_options => ['dmode=777', 'fmode=777']
当我在主机和来宾中创建/修改文件时,就会发生这种情况:它们只是不可访问:
cannot access GuzzleStreamWrapper.php: No such file or directory
什么都不值钱,我可以在控制台中列出它们,但没有权限(看起来像安装问题):
vagrant@precise64:/vagrant/Beautyportal/vendor/guzzlehttp/streams/src$ ls -al
ls: cannot access functions.php: No such file or directory
ls: cannot access NoSeekStream.php: No such file or directory
ls: cannot access LazyOpenStream.php: No such file or directory
ls: cannot access MetadataStreamInterface.php: No such file or directory
ls: cannot access StreamInterface.php: No such file or directory
ls: cannot access LimitStream.php: No such file or directory
ls: cannot access AppendStream.php: No such file or directory
ls: cannot access Stream.php: No such file or directory
ls: cannot access CachingStream.php: No such file or directory
ls: cannot access StreamDecoratorTrait.php: No such file or directory
ls: cannot access GuzzleStreamWrapper.php: No such file or directory
total 12
drwxrwxr-x 1 vagrant vagrant 4096 Aug 14 11:33 .
drwxrwxr-x 1 vagrant vagrant 4096 Aug 14 11:33 ..
?????????? ? ? ? ? ? AppendStream.php
?????????? ? ? ? ? ? CachingStream.php
?????????? ? ? ? ? ? functions.php
?????????? ? ? ? ? ? GuzzleStreamWrapper.php
?????????? ? ? ? ? ? LazyOpenStream.php
?????????? ? ? ? ? ? LimitStream.php
?????????? ? ? ? ? ? MetadataStreamInterface.php
?????????? ? ? ? ? ? NoSeekStream.php
?????????? ? ? ? ? ? StreamDecoratorTrait.php
?????????? ? ? ? ? ? StreamInterface.php
?????????? ? ? ? ? ? Stream.php
drwxrwxr-x 1 vagrant vagrant 4096 Aug 14 11:33 .svn
重新启动机器(vagrant reload
)后,文件可以访问,因此我怀疑安装/重新安装有问题。
linux mint 13主机以及Windows 7 64bit主机都出现了此问题。盒子是hashicorp/precise64
我认为我已经找到了问题,这是由于重复的安装-默认情况下,vagrant将活动主机目录安装/home/user/vagranthost
到/vagrant
。我所做的是,我将其他子目录作为安装点添加/home/user/vagranthost/project
到了中/vagrant/project
,从而创建了一个碰撞,流浪者无法识别(尚未)并允许其安装。
因此,解决方案是编辑Vagrantfile
并更改行
config.vm.synced_folder "/home/ulkas/Develop/beauty/Beautyportal", "/vagrant/Beautyportal", owner: "vagrant", group: "vagrant", :mount_options => ['dmode=777', 'fmode=777']
进入
config.vm.synced_folder "/home/ulkas/Develop/beauty", "/vagrant", owner: "vagrant", group: "vagrant", :mount_options => ['dmode=775', 'fmode=775']
为了调试,这是在以下mount
命令的输出中:
/vagrant on /vagrant type vboxsf (uid=1000,gid=1000,rw)
/vagrant/Beautyportal on /vagrant/Beautyportal type vboxsf (uid=33,gid=1000,rw)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句