我正在Windows上运行Homestead v8.0.1的新版本。
我的Homestead.yml文件看起来像这样:
---
ip: "192.168.99.20"
memory: 2048
cpus: 1
provider: virtualbox
backup: true
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Documents/example
to: /home/vagrant/code/dealer-app
sites:
- map: example.test
to: /home/vagrant/code/example/public
type: "apache"
databases:
- example
ports:
- send: 4200
to: 4200
- send: 49153
to: 49153
我做了以下事情:
$ git clone https://github.com/laravel/homestead.git .
$ git checkout v8.0.1
$ init.bat
$ vagrant up
在我收到此错误之前,大多数方法都有效:
homestead-7: Running: script: Update Composer
homestead-7: Updating to version 1.8.2 (stable channel).
homestead-7:
homestead-7:
homestead-7: [ErrorException]
homestead-7: rename(/home/vagrant/.composer/cache/composer-temp.phar,/usr/local/bin/composer): Permission denied
为什么这不起作用?
看homestead.rb
,它具有:
config.vm.provision 'shell' do |s|
s.name = 'Update Composer'
s.inline = 'sudo -u vagrant /usr/local/bin/composer self-update --no-progress && sudo chown -R vagrant:vagrant /home/vagrant/.composer/'
s.privileged = false
end
那么在Windows版本的Vagrant上运行chown可能是个问题吗?
更新
我设法通过将homestead.rb
作曲家部分编辑为:
config.vm.provision 'shell' do |s|
s.name = 'Update Composer'
s.inline = '/usr/local/bin/composer self-update --no-progress && chown -R vagrant:vagrant /home/vagrant/.composer/'
s.privileged = true
# s.inline = 'sudo -u vagrant /usr/local/bin/composer self-update --no-progress && sudo chown -R vagrant:vagrant /home/vagrant/.composer/'
# s.privileged = false
end
这是正确的吗?这是一个宅基虫吗?