Fixing a Laravel Homestead 2.0.8 Problem

I've encountered this a couple of times recently. Apparently there is a HOME path problem with Homestead 2.0.8. I'll share with you a couple of solutions I have come across.

Error:

$ homestead up
    /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/shared_helpers.rb:96:in `expand_path': couldn't find HOME environment -- expanding `~' (ArgumentError)
        from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/shared_helpers.rb:96:in `expand_path'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/shared_helpers.rb:96:in `user_data_path'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/manager.rb:16:in `user_plugins_file'
        from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/manager.rb:27:in `instance'
        from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/lib/vagrant/pre-rubygems.rb:22:in `<main>'

I've come across two solutions for this:

1) Switch to Homestead 2.0.7

To downgrade to laravel/homestead:2.0.7 you just need to edit your file: ~/.composer/composer.json to read:

{
    "require": {
        "laravel/homestead": "2.0.7"
    }
}

and do a composer global update.

2) Edit php.ini

To fix this you need to find the variables_order option in your php.ini and add an "E", so that it becomes

variables_order = "EGPCS"

If you need to find your php.ini file type:

$ php --ini

php --ini

This is the method I prefer to use, just because I don't like to downgrade if I don't have to.