我正试着让Laravel Homestead起来跑步.我通过http://laravel.com/docs/4.2/homestead顺利完成了所有步骤.我要做的最后一件事是编辑我的homestead.yaml文件(我做过)并运行homestead up
.但每次我尝试homestead up
我得到这个输出:
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/shared_helpers.rb:89:in `expand_path': couldn't find HOME environment -- expanding `~' (ArgumentError) from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/shared_helpers.rb:89:in `expand_path' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/shared_helpers.rb:89:in `user_data_path' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/manager.rb:16:in `user_plugins_file' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/manager.rb:27:in `instance' from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/lib/vagrant/pre-rubygems.rb:22:in `'
有谁知道为什么会发生这种情况以及如何解决?
注意:我是终端的菜鸟,我刚刚开始关注laracast的教程,所以我的终端正在使用Oh-my-zsh和Homebrew,据说如果可能的话,zsh或Homebrew语法将是最有帮助的.
经过一些研究,这似乎是版本2.0.8中的错误.解决方案是恢复到v2.0.7
首先删除当前的homestead 2.0.8文件夹
rm -rf ~/.composer/vendor/laravel/homestead
然后安装Homestead v2.0.7
composer global require laravel/homestead:v2.0.7
来自Laracasts论坛的答案 在Homestead 2.0.8中为我解决了这个问题:
..除非你在php.ini中明确说明它,否则不会填充$ _ENV数组.[...]
要解决这个问题,请在php.ini中找到variables_order并在字符串中添加"E",如下所示:variables_order ="EGPCS".