# Discourse::Utils.execute\_command not using path

**URL:** https://meta.discourse.org/t/discourse-utils-execute-command-not-using-path/305476
**Category:** Development
**Created:** [April 25, 2024, 8:43pm UTC](https://meta.discourse.org/t/discourse-utils-execute-command-not-using-path/305476 "2024-04-25T20:43:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 25, 2024, 8:43pm UTC](https://meta.discourse.org/t/discourse-utils-execute-command-not-using-path/305476/1 "2024-04-25T20:43:00Z")

</div>

My plugin needs `ansible`. I was installing it with `apt-get`, but that version in debian seems broken, so I tried installing it with `pipx install --include-deps ansible`. So far so good. Works just fine as either root or discourse. But when my command runs with `#!/usr/bin/env ansible-playbook` it can’t find it. I’ve done all sorts of things making sure that the path includes `~/.local/pipx/venvs/ansible/bin`, and it works in shells, but when Rails runs it, it can’t find it.

```plaintext
create_droplet ansible task failed error_message: /var/www/discourse/lib/discourse.rb:138:in `exec': /usr/bin/env: ‘ansible-playbook’: No such file or directory

```

~~I’m stumped.~~

I fixed it by installing ansible like this:

```plaintext
PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install --force --include-deps ansible 

```

Now I’m working on getting jmespath installed such that Ansible can find it. 😿
