提问者:小点点

Laravel无法将文件夹映射到霍姆斯特德


我安装了流浪汉

流浪向上工作,但文件夹不是我配置文件的位置。

我的家园. yaml设置的文件夹是~/Documents/发展/home,但是流浪设置是/流浪到 /User/Docuements/Homestead

有人能帮我找出它有什么问题吗?

这是我的配置文件Homestad. yaml

ip: "192.168.10.10"
  3 memory: 2048
  4 cpus: 1
  5 provider: virtualbox
  6  
  7 authorize: ~/.ssh/id_rsa.pub
  8  
  9 keys:
 10     - ~/.ssh/id_rsa
 11  
 12 folders:
 13     - map: ~/Documents/develop
 14       to: /home
 15  
 16 sites:
 17     - map: goldenquant.app
 18       to: /home/goldenquant/public
 19     - map: blog.app
 20       to: /home/blog/public
 21  
 22 databases:
 23     - homestead

这是我的终端运行流浪者起来的结果。

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: Homestead_default_1468067791872_61342
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> 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: Warning: Connection timeout. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/Xing/Documents/Homestead

共2个答案

匿名用户

您实际上可以通过告诉Vagant不要生成新的密钥对来禁用此功能:

config.ssh.insert_key = false

你可以看到这里发生的PR

匿名用户

您是否尝试运行流浪者--debug?(参见文档)

但是我可以想象试图映射到VM上的 /home可能是个问题,尝试/home/magrat中的目录,并为地图的本地部分使用完整路径,例如,

folders:
    - map: /Users/Xing/Documents/develop
      to: /home/vagrant/develop

或者类似的。我肯定在某个地方有更完整的文档,但请参阅此以获取一些工作示例。