1

I installed the composer on my mac os and install laravel and added it to the path

so now printing the path you can see

 sudo nano /etc/paths

the result is:

/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myname/.composer/vendor/bin/laravel

so laravel is there, however, when I do:

laravel new blog

I got this error:

-bash: laravel: command not found
Phiter
  • 14,570
  • 14
  • 50
  • 84
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
  • Is `laravel` executable? Please give the result of `ls -l /Users/myname/.composer/vendor/bin/laravel`. – A.L Feb 25 '16 at 23:31
  • http://stackoverflow.com/questions/28597648/laravel-5-installation-in-ubuntu-laravel-command-not-found – m2j Feb 25 '16 at 23:35
  • Have you restarted the terminal since updating the path? You'll need to do that, or source your bash file – Jeff Feb 25 '16 at 23:57
  • @A.L i got this lrwxr-xr-x 1 myname staff 28 Feb 25 23:14 /Users/myname/.composer/vendor/bin/laravel -> ../laravel/installer/laravel – Marco Dinatsoli Feb 26 '16 at 00:10
  • @Jeff yes I did restart the terminal – Marco Dinatsoli Feb 26 '16 at 00:10
  • @m2j i looked on that question, and adding sudo didn't help neither – Marco Dinatsoli Feb 26 '16 at 00:11
  • Can you run `/Users/myname/.composer/vendor/bin/laravel` directly? It looks like your profile don't use `/etc/paths`. Use `echo $PATH` to see the loaded paths. It seems that `/Users/myname/.composer/vendor/bin/laravel` is a file, IIRC you have to provide the directory path (`/Users/myname/.composer/vendor/bin/`), not the file path. – A.L Feb 26 '16 at 00:12
  • @A.L this /Users/myname/.composer/vendor/bin/laravel new ElasticWebApp solved the problem, thanks! you may write an answer if you wish – Marco Dinatsoli Feb 26 '16 at 00:16
  • @MarcoDinatsoli Glad to see I helped you. Did using `/Users/myname/.composer/vendor/bin/` (without `laravel`) worked for you? – A.L Feb 26 '16 at 00:21
  • Possible duplicate of [Laravel installation: How to place the ~/.composer/vendor/bin directory in your PATH?](http://stackoverflow.com/questions/25373188/laravel-installation-how-to-place-the-composer-vendor-bin-directory-in-your) – MrTux Jul 03 '16 at 23:17

1 Answers1

1

the result is:

/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myname/.composer/vendor/bin/laravel

(emphasize mine)

See how most of the paths end with bin, but not the one with laravel.

You have to provide the path of the directory which contain the laravel command, your $PATH should be:

/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myname/.composer/vendor/bin/

A.L
  • 10,259
  • 10
  • 67
  • 98