我正在windows上运行Homestead v8.0.1的新版本。
---
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
我设法通过编辑解决了这个问题
作曲部分至:
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