Laravel宅基地没有映射我的代码文件夹

时间:2015-10-13 22:05:43

标签: laravel vagrant virtualbox homestead

按照说明here

,我试图让家园工作

我在Windows 8上安装了Virtualbox 5.0.6和Vagrant 1.7.4。机器启动正常(ish)唯一的问题是我的映射文件夹不存在于vm上,这意味着当我vagrant ssh时,目录/home/vagrant/为空,其中没有Code目录。这是机器启动的屏幕截图(它应该继续并说明映射文件夹和内容):

machine booting

这是我的Homestead.yaml文件

的内容
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: C:\Users\Khalid\.ssh\id_rsa.pub

keys:
    - C:\Users\Khalid\.ssh\id_rsa

folders:
    - map: D:\work
      to: /home/vagrant/Code

sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp

有人可以帮忙,谢谢

编辑:可以找到vagrant up --debug的完整输出here

3 个答案:

答案 0 :(得分:7)

sstarlight走在了正确的轨道上。这是一个路径名称问题。我也在带有家园的Windows 8上,你甚至需要在你的窗户路径中使用正斜杠。

以下应该可以做到!

authorize: C:/Users/Khalid/.ssh/id_rsa.pub

keys:
    - C:/Users/Khalid/.ssh/id_rsa

folders:
    - map: D:/work
      to: /home/vagrant/Code

sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public

我想补充一点,你应该通过设置--provision标志来改变你的家园后,按照另一个答案运行配置。

答案 1 :(得分:1)

确保并重新验证var React = require('react'); var Catalog = require('./Catalog'); // var cart = require('./cart'); var contents = [ <Catalog onIncrementCount={this.onIncrementCount}/> // ,<cart /> ]; var AppWrapper = React.createClass({ getInitialState: function() { return { currentTab: 0, count: 0 }; }, onIncrementCount: function() { this.setState({count: this.state.count + 1}); alert(this.state.count) }, render: function() { return ( <div> <div className="site-wrapper"> <div className="site-wrapper-inner"> <div className="cover-container"> <div className="masthead clearfix"> <div className="inner"> <h3 className="masthead-brand"> <img src="images/naleczowianka-logo.png" /> </h3> <nav> <ul className="nav masthead-nav"> <li className="active"><a href="#" >English <span className="glyphicon glyphicon-menu-down"></span></a></li> <li><a href="#"><span className="glyphicon glyphicon-log-in"></span>&nbsp; Login</a></li> </ul> </nav> </div> </div> <br /> <div className="inner cover"> <header className="row"> <div className="col-md-12"> <div className="row"> <div className="col-md-4 col-xs-4"><h4 className="active">Choose Product</h4></div> <div className="col-md-4 col-xs-4"><h4> <a href="#"> <span className="glyphicon glyphicon-shopping-cart"> </span> &nbsp; </a> <a href="http://www.google.com" className="NavLinks" >Shopping Cart ( {this.state.count} ) </a> </h4></div> <div className="col-md-4 col-xs-4"><h4>Order</h4></div> </div> <br /> <div className="progress"> <div className="progress-bar progress-bar-striped active width-15" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" > <span className="sr-only">15% Complete</span> </div> </div> </div> </header> <br /> <main className="row box"> <div className="col-md-12"> <div className="row"> <div > {contents[this.state.currentTab] } </div> <br /> <div className="row"> <div className="col-md-6"> <h4>Still Waters</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p> </div> <div className="col-md-6"> <h4>Sparkling Waters</h4> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p> </div> </div> </div> </div> </main> <div className="mastfoot"> <div className="inner row"> <div className="col-md-4 col-xs-4"> <a href="">Rahl Trading</a> </div> <div className="col-md-4 col-xs-4"> <a href="">Frequently Asked Questions</a> </div> <div className="col-md-4 col-xs-4"> <a href="">Privacy</a> </div> </div> </div> </div> </div> </div> </div> </div> ); }, selectTab: function(tab) { this.setState({ currentTab: tab }); // this.props.tabChanged(tab); } }); module.exports = AppWrapper;keys的路径是否正确并运行authorize以重新设置宅基地设置

答案 2 :(得分:0)

尝试更改

 D:\work to D:/work/