Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Homestead Installation: bash init.sh not working

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

like image 671
Maxim Laco Avatar asked Jan 14 '15 19:01

Maxim Laco


2 Answers

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!

like image 53
user3430353 Avatar answered Oct 21 '22 23:10

user3430353


.sh is a unix/linux script executable, that isn't recognized on Windows. There's a init.bat included in the package, but it isn't referenced in the tutorial.

Just run init.bat from the command line. It will copy the files to:

%HOMEDRIVE%%HOMEPATH%\.homestead
like image 43
James Durkee Avatar answered Oct 22 '22 01:10

James Durkee