Laravel Homestead Installation: bash init.sh not working

Maxim Laco picture Maxim Laco · Jan 14, 2015 · Viewed 14.5k times · Source

I'm trying to install Laravel Homestead in order to be able to test my Laravel projects locally.

I'm following this tutorial: http://laravel.com/docs/4.2/homestead

In the "Installing Homestead" part I followed the second step "Manually Via Git (No Local PHP)",I don't have any PHP installed locally and can't use Composer. (Wasn't PHP supposed to be installed as part of Homestead?)

I got to this part:

Once you have installed the Homestead CLI tool, run the bash init.sh command to create the Homestead.yaml configuration file:

bash init.sh

In command prompt I tried to enter the following command:

bash init.sh

I got the following error:

'bash' is not recognized as an internal or external command, operable program or batch file.

Then I tried to enter the same command in Git Bash, and I got the following error:

bash: init.sh: No such file or directory

When I tried to enter in Git Bash simply

init.sh

I got the following error:

sh.exe": init.sh: command not found

Answer

user3430353 picture user3430353 · Jan 28, 2015

I ran into this problem well. You need to hop into your terminal (I am on Mac.)

  • Type into your console: cd ~/Homestead
  • and to make sure you are in your newly generated Homestead folder (you can always click Finder > your home directory > Homestead to confirm it's where it should be),
  • then while in terminal simply type ls -- if it lists all of the files like Vagrantfile, composer.lock and bash init.sh, you should be in.

Once you know you are in the correct Homestead folder, it is now at that point in which you run bash init.sh

After doing this it now says Homestead initialized!