# Bug with composer module on OSX

**URL:** <https://forum.ansible.com/t/bug-with-composer-module-on-osx/15627>\
**Category:** Ansible Project\
**Created:** [July 9, 2014, 2:48am UTC](https://forum.ansible.com/t/bug-with-composer-module-on-osx/15627 "2014-07-09T02:48:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cameron\_Junge](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Cameron\_Junge](https://forum.ansible.com/u/Cameron_Junge)\
**Post date:** [July 9, 2014, 2:48am UTC](https://forum.ansible.com/t/bug-with-composer-module-on-osx/15627/1 "2014-07-09T02:48:44Z")

</div>

Hi All,

I guess this isn’t a common case, but I’ve experienced an error with using the composer module on an OSX machine. Runs perfectly on Linux, with the same exact settings!

`

TASK: [Composer install] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
 REMOTE\_MODULE composer no\_dev=False working\_dir=/tmp/deploy  
  
EXEC [‘/bin/sh’, ‘-c’, ‘mkdir -p  
$HOME/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643 &&  
chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643  
&& echo  
$HOME/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643’]  
  
PUT /var/folders/fx/51cy7j4978xdtx6b4ck5jcl00000gp/T/tmpwxXuuC TO  
/Users/markc/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643/composer  
  
EXEC [‘/bin/sh’, ‘-c’, u’LC\_CTYPE=en\_US.UTF-8 SYMFONY\_ENV=dev  
LANG=en\_US.UTF-8 /usr/bin/python  
/Users/markc/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643/composer;  
rm -rf  
/Users/markc/.ansible/tmp/ansible-tmp-1404425204.93-218640203058643/

> /dev/null 2\>&1’]  
> ok:  
> [localhost] =\> {“changed”: false, “msg”: “/usr/bin/env php -d  
> allow\_url\_fopen=On -d detect\_unicode=Off  
> /usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar $\*”}

`

The last line is strange, completely different to what is shown on Linux (it’s meant to be the composer output).

The task is:

`

- name: Composer install  
environment: symfony\_environment  
tags: [“composer”]  
composer:  
working\_dir: “{{ composer\_dir }}”  
optimize\_autoloader: yes  
prefer\_dist: yes  
no\_dev: “{{ composer\_no\_dev }}”  
`

Cheers, Cameron

---

<div class="post-metadata">

**Author:** ![Andrew\_Udvare](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@Andrew\_Udvare](https://forum.ansible.com/u/Andrew_Udvare)\
**Post date:** [July 9, 2014, 8:45am UTC](https://forum.ansible.com/t/bug-with-composer-module-on-osx/15627/2 "2014-07-09T08:45:06Z")

</div>

What is composer\_dir?

I have a feeling you are pointing to the wrong file (as in not the real phar file). The real phar looks like it’s on your system at /usr/local/Cellar/composer/1.0.0-alpha8/libexec/composer.phar

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 9, 2014, 7:32pm UTC](https://forum.ansible.com/t/bug-with-composer-module-on-osx/15627/3 "2014-07-09T19:32:28Z")

</div>

Changed false seems to imply it did not think it needed to install anything, because it already was present.

Could this be the case?

---

<div class="post-metadata">

**Author:** ![Cameron\_Junge](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Cameron\_Junge](https://forum.ansible.com/u/Cameron_Junge)\
**Post date:** [July 10, 2014, 8:10pm UTC](https://forum.ansible.com/t/bug-with-composer-module-on-osx/15627/4 "2014-07-10T20:10:58Z")

</div>

composer\_dir is the location of the composer.json file. There is no composer.phar at that location as I’m relying on it being installed system-wide.

If it’s something to do with how composer was installed, it was done using Homebrew, and the module itself finds the location of the composer.phar executable.

---

<div class="post-metadata">

**Author:** ![Cameron\_Junge](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Cameron\_Junge](https://forum.ansible.com/u/Cameron_Junge)\
**Post date:** [July 10, 2014, 8:13pm UTC](https://forum.ansible.com/t/bug-with-composer-module-on-osx/15627/5 "2014-07-10T20:13:32Z")

</div>

No, as it was a fresh checkout from Git with no vendors installed.

The same playbook runs perfectly on Linux, but fails on OSX.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 11, 2014, 10:28pm UTC](https://forum.ansible.com/t/bug-with-composer-module-on-osx/15627/6 "2014-07-11T22:28:21Z")

</div>

Filing a ticket may be a good idea 🙂
