Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to install Composer on OSX 10.9

I'm trying to install Composer on OSX 10.9 following the instructions from getcomposer.org using this command:

curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local

Result:

#!/usr/bin/env php
All settings correct for using Composer

Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to write bundled     cacert.pem to: /Users/aaron.rossano/.composer/cacert.pem' in -:402
Stack trace:
#0 -(112): installComposer(false, '/usr/local', 'composer.phar', false, false, false)
#1 -(14): process(Array)
#2 {main}
thrown in - on line 402
like image 540
Aharon Rossano Avatar asked Dec 11 '25 06:12

Aharon Rossano


2 Answers

This is a bug introduced on 3/9/14. I sent a pull request to fix it:

https://github.com/composer/getcomposer.org/pull/62

In the mean time, just manually create a .composer folder in your home directory.

like image 152
jimbojsb Avatar answered Dec 13 '25 19:12

jimbojsb


As an alternative, try downloading an older version of the Composer installer from GitHub. Simply replace the curl endpoint to a previous state of the installer file, e.g.:

curl -sS https://raw.github.com/composer/getcomposer.org/c6fedc418e1f80347724cf1bc3e86b607ac3ba30/web/installer | php -- --install-dir=/usr/local

Note: This is an older version of the installer only, not Composer itself. It'll download the latest version of Composer.

Additionally, to execute as superuser:

sudo sh -c "curl -sS https://raw.github.com/composer/getcomposer.org/c6fedc418e1f80347724cf1bc3e86b607ac3ba30/web/installer | php -- --install-dir=/usr/local"
like image 25
Jacob Budin Avatar answered Dec 13 '25 20:12

Jacob Budin