5

I installed docker and downloaded an ubuntu distro to run with laravel sail,planing to use swoole php,and made it default,also made wsl version to 2 enter image description here

with docker-compose.yml ready from laravel sail docker-compose.yml: enter image description here

but every time I try to run the sail up cmd,it gives me this error " Unsupported operating system [MINGW64_NT-10.0]. Laravel Sail supports macOS, Linux, and Windows (WSL2)."

enter image description here

any ideas how to fix this ?

Connell.O'Donnell
  • 3,603
  • 11
  • 27
  • 61
  • Tried using cmd.exe? – 0xLogN Feb 28 '21 at 19:57
  • i did,but it do no work,i saw some ppl say i have to use bash not cmd,because bash is interpreted – Ahmed Wagih Refaey Feb 28 '21 at 20:31
  • cmd : " ./vendor/bin/sail up " response : " '.' is not recognized as an internal or external command, operable program or batch file. " cmd : " /vendor/bin/sail up " response : " 'vendor' is not recognized as an internal or external command, operable program or batch file. " cmd : " vendor/bin/sail up " response : " 'vendor' is not recognized as an internal or external command, operable program or batch file. " even though i did php artisan sail:install – Ahmed Wagih Refaey Feb 28 '21 at 20:33
  • cmd is interpreted too... -- you have to do `vendor\bin\sail up` in cmd, no `./` or `/` sep – 0xLogN Feb 28 '21 at 22:48
  • 1
    C:\wamp64\www\mtqdma\l_8\mzaedh>vendor\bin\sail up | /bin/bash: C:\wamp64\www\mtqdma\l_8\mzaedh\vendor\bin\/../laravel/sail/bin/sail: No such file or directory – Ahmed Wagih Refaey Mar 01 '21 at 00:03

2 Answers2

14

If you are using windows follow these steps.

  1. Make sure ubuntu and WSL 2 is installed, you can follow the instructions here
  2. After successful installation of ubuntu, your file system now shares the same file system with your ubuntu, this means if you want to run ubuntu commands on a folder path you have to open the corresponding terminal. If you are using Visual Studio Code, you can select the corresponding ubuntu terminal for the file directory by selecting ubuntu as the new terminal, it will open the Ubuntu terminal on the current path.
  3. You can run ./vendor/bin/sail up. Make Sure you are running the command from your project folder in Ubuntu. Usually the folder is always in /mnt/c/users/path/to/project.
  4. If you see docker not running. Open your docker desktop, go to setting, under resources, select WSL and enable integration with your ubuntu Integrating WSL ubuntu with docker
  5. Restart your terminal, and run the command again. Don't forget under you Ubuntu file system which is usually in /mnt/c/users/path-to-laravel-project. you should see the following for the first time. Note the folder path highlighted.Laravel Sail running for the first time
  6. One last thing, in order to access your laravel app on your localhost, you have to access the WSL IP address that connects to Ubuntu. use the following command. wsl hostname -i it outputs an IP address like enter image description here, Note! your IP address may be different. Navigate to the IP address on default port 80 and you should see.Laravel Sail running Succesfully

I wish you a successful project. Enjoy!!

Emmanuel Aliji
  • 377
  • 3
  • 9
8

You need to run the sail up command from inside your WSL2 Ubuntu Image not directly from your terminal. Once you do that it should work ok

MikeBrandl
  • 96
  • 2