我有一个作为 Vagrant Box 运行的 Ubuntu 12.04.5 虚拟机。
我现在想安装一些 Composer 依赖项。这是我的 composer.json
:
{
"name": "sample/website",
"require": {
"php": ">=5.3.0",
"ext-curl": "*",
"ext-json": "*",
"paypal/rest-api-sdk-php" : "*"
}
}
一切正常,但现在当我导航到:
/vagrant/site/vendor/paypal/rest-api-sdk-php/lib
然后运行 ls -la
我看到了这个:
ls: cannot access PayPal: No such file or directory
total 0
drwxr-xr-x 1 vagrant vagrant 102 Oct 23 19:16 ./
drwxr-xr-x 1 vagrant vagrant 510 Oct 23 19:16 ../
?????????? ? ? ? ? ? PayPal
我无法cd
、rm
或chmod
或chown
目录。有些地方建议尝试更改其权限,因为我可能没有执行该文件的权限,但我无法执行任何操作。
我可以从我的主机 (OSX 10.9.5) 完全正常地访问它。
这甚至发生在我直接从 GitHub 克隆 PayPal 存储库时。
有什么线索吗?
最佳答案
事实证明,这是 Vagrant 无法跟踪已同步文件夹的更广泛问题的一部分。问题也在这里详细说明:https://github.com/mitchellh/vagrant/issues/985
我从该链接中获取的解决方案是遵循以下内容:http://blog.csanchez.org/2012/05/03/automatically-download-and-install-virtualbox-guest-additions-in-vagrant/
您需要安装最新版本的 guest 添加:
vagrant gem install vagrant-vbguest
然后在你的Vagrantfile
中,添加
Vagrant::Config.run do |config|
# set auto_update to false, if do NOT want to check the correct additions
# version when booting this machine
config.vbguest.auto_update = false
end
关于ubuntu - 在 Vagrant 虚拟机中使用 Composer 下载依赖项会导致文件夹损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26535885/