I'm trying to get Laravel Homestead up and running. I've smoothly made it through all the step via http://laravel.com/docs/4.2/homestead. The last thing I have to do is edit my homestead.yaml file (which I did) and run homestead up. But every time I try homestead up I get this output:
☁ ~ 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 `<main>'
Anyone know why this is happening and how to fix. ive been struggling with this for 2 days now and its driving me nuts! Thanks
I just updated Laravel Homestead and I am encountering the same problem. I haven't found anything beneficial on the web yet. I'll keep troubleshooting and let you know if I find a solution. It definitely is irritating!
Already tried that, but unfortunately no luck. I've tried to set it in my .zshrc file (I'm using Oh My Zsh). Thanks for the effort though, greatly appreciated.
Remember, you can directly input export into the CLI and it will be set for that session. No need to put it into your rc file just for testing (which would also need a shell restart).
It's this part which it can't find (from the file it's erroring on)
# This returns the path to the ~/.vagrant.d folder where Vagrant's
# per-user state is stored.
#
# @return [Pathname]
def self.user_data_path
# Use user spcified env var if available
path = ENV["VAGRANT_HOME"]
# On Windows, we default to the USERPROFILE directory if it
# is available. This is more compatible with Cygwin and sharing
# the home directory across shells.
if !path && ENV["USERPROFILE"]
path = "#{ENV["USERPROFILE"]}/.vagrant.d"
end
# Fallback to the default
path ||= "~/.vagrant.d"
Pathname.new(path).expand_path
end
Similar issue here.
After updating to homestead 2.0.8, "homestead" command seems to be broken...
"vagrant is not recognized as an internal or external command"
Because I don't want to deal with Homestead horrible v2 (first PHP composer based CLI, now this, one VM per user, etc), I create a simple fork to use it like any Vagrant box: https://github.com/zoontek/purestead
I know it's far from a solution, but I do the job.
So I fixed the issue on my machine. Turns out that the $_ENV array isn't populated unless you explicitly state it in the php.ini. The commit that Taylor made to Laravel Homestead works to pass the $_ENV variable, it's just that it's empty by default.
To solve it, find the variables_order in your php.ini and add 'E' to the string, like so:
variables_order = "EGPCS".
Where do I place this page file? and how will I access this page?
As I understand, "homestead up" will make the homestead laravel guest machine run -- which I can't and then I can more or less work with the apps with the guest machine.
I can't make homestead up work for the same reason as the first post here.
Forgive me, I am disoriented. I do have a local php running in my desktop if that's what the post mean and not the one that is run via homestead... let me try.
The way @ELD suggests is way better than my link. Run the command he provides in your local machine's terminal. You need your local php to run the homestead CLI tool. Alternatively you could also clone the git repository yourself and use Homestead without the CLI tool. For more information on this please take a look at the docs.
@UnSeulT good to know. I didn't even know about that command. That is even easier. No need to pipe to grep. And yes, a subtle but aggravating difference between true Linux systems and Macs. Nothing that didn't take a little getting used to, but still irritating.
If you downgrade or move version the homestead version, FYI you will lose your .vagrant files / ability to use vagrant up . So you will need to open virtualbox to start the machine and salvage any mysql databases needed.
Heres a patch to get it working again
Open ~/.composer/vendor/laravel/homestead/homestead
Add
$_ENV['HOME'] = getenv('HOME');
After
$_ENV['VAGRANT_DOTFILE_PATH'] = '~/.homestead/.vagrant';