Have you made it executable?
Composer doesn't work, OSX El Capitan.
I've just installed composer using curl -sS https://getcomposer.org/installer | php and it works so far, I can move it using sudo mv composer.phar /usr/local/bin, but when I'm trying to run nothing works. I've tried composer.phar, php composer.phar and php composer. What to do?
I've nothing more than the above, and when I try to invoke it, it just says -bash: composer: command not found.
Give us output of ls -la /usr/local/bin/composer.phar
ls: /usr/local/bin/composer.phar: Not a directory
Execute this.
ls -la /usr/local/bin/composer.phar
I pasted the response.
I know but you did something wrong. Paste what I wrote to your console and execute it and after that give us the output.
I posted yours and it responded with: ls: /usr/local/bin/composer.phar: Not a directory
Google for "not a directory" error and find solution ;)
I've done that before consulting this forum ;o) It tells me that /bin is a not directory and I can't cd into it.
I used this on Yosemite and it worked just fine.
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
EDIT: Just had another look and I think I know where you went wrong. You renamed composer to 'bin' overwriting the folder:
and it works so far, I can move it using sudo mv composer.phar /usr/local/bin
Mine respond with: "mv: rename composer.phar to /usr/local/bin/composer: Not a directory", I'm starting to think that something has changed in El Captitan, I had no problems on Yosemite either.
@Kudos read my update above :)
Oh, how can I change this? :O
You're pretty stuffed unless you have a backup of the 'bin' folder. I'm not sure what else you have installed over a stock El Capitan but I guess you're missing a bunch of stuff now.
Maybe it's time for a fresh installation ;o) :-/
Or maybe you can copy it from someone. But I guess fresh installation would be the best option.
Or if you have Time Machine running; backing up the whole system, you can restore from there. Make sure you "un-hide" the system files first before checking. By default, TM grabs the whole system.
EDIT: Just had another look and I think I know where you went wrong. You renamed composer to 'bin' overwriting the folder:
/bin is a folder, he's moving a executable. So I doubt he renamed his bin folder.
ls -la /usr/local/bin/composer.phar
composer.phar is not a directory, it's a file so ls gives correct response.
If you did sudo mv composer.phar /usr/local/bin you just moved the the composer.phar to bin folder without renaming it.
Composer documentation says:
Note: On some versions of OSX the /usr directory does not exist by default. If you receive the error "/usr/local/bin/composer: No such file or directory" then you must create the directory manually before proceeding: mkdir -p /usr/local/bin.
@alenabdula please type
which composer.phar
from a command line and paste it here. I had some fun with the 'Captain' but composer was fine.
My /usr directory exist, I can cd into it, but I can't cd into usr/local/bin, not even after a fresh install? I can cd into /usr/local, but that's it.
Do this
cat /usr/local/bin
or this
tail /usr/local/bin
and this
ls -la /usr/local
The solution was to create the directory manually. Thanks for your time everyone :o)
@alenabdula Thanks. It worked for me.
Please or to participate in this conversation.