# ansible gem not installing dependencies

**URL:** <https://forum.ansible.com/t/ansible-gem-not-installing-dependencies/16614>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 26, 2014, 11:57pm UTC](https://forum.ansible.com/t/ansible-gem-not-installing-dependencies/16614 "2014-10-26T23:57:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_Soetanto](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@J\_Soetanto](https://forum.ansible.com/u/J_Soetanto)\
**Post date:** [October 26, 2014, 11:57pm UTC](https://forum.ansible.com/t/ansible-gem-not-installing-dependencies/16614/1 "2014-10-26T23:57:58Z")

</div>

Hi there,

I tried to install fluentd elasticsearch plugin using ansible gem, however for some reason the installation does not install the dependencies even though i explicitly set to install dependencies

Background:

- ansible 1.7.1

- ubuntu 12.04

- elasticsearch installed separately

- install fluentd from tresuredata repo` `

Trying the following code result with success, however the td-agent service can’t start because it is missing some dependencies

`gem: name=fluent-plugin-elasticsearch state=present executable=/opt/td-agent/embedded/bin/fluent-gem include_dependencies=yes`

When starting the service ,receive error

`  
fluent/supervisor.rb:257:rescue in main\_process: config error file=“/etc/td-agent/td-agent.conf” error=“Unknown output plugin ‘elasticsearch’. Run ‘gem search -rd fluent-plugin’ to find plugins”

`

However if i execute it using standard command (below) , i don’t encounter the problem

`command: /opt/td-agent/embedded/bin/fluent-gem install fluent-plugin-elasticsearch`

How do i know it is missing dependencies? When i see the gem list under td-agent directory (/opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/) no elasticsearch listed there when installing using “ansible gem” . if i try to install elasticsearch using “ansible gem” it will complain it is missing other fluentd plugins.

Is this problem with gem plugin ? or can anyone shed any light on this?

Thanks,

---

<div class="post-metadata">

**Author:** ![J\_Soetanto](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@J\_Soetanto](https://forum.ansible.com/u/J_Soetanto)\
**Post date:** [October 27, 2014, 1:43am UTC](https://forum.ansible.com/t/ansible-gem-not-installing-dependencies/16614/2 "2014-10-27T01:43:39Z")

</div>

​Really weird, after tinkering i got it working by adding “user\_install=no” . The gem executable is slightly different

`

gem: name=fluent-plugin-elasticsearch state=present executable=/usr/sbin/td-agent-gem user\_install=no​  
`

For some reason without user install option , i found that the gem was installed under root home directory. Shouldn’t by default it install it system wide?

---

<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:** [October 30, 2014, 5:55pm UTC](https://forum.ansible.com/t/ansible-gem-not-installing-dependencies/16614/3 "2014-10-30T17:55:45Z")

</div>

“For some reason without user install option , i found that the gem was installed under root home directory. Shouldn’t by default it install it system wide?”

I would hope so, yes.

Perhaps this is something about that particular gem?

---

<div class="post-metadata">

**Author:** ![Kyle\_Tarplee](https://avatars.discourse-cdn.com/v4/letter/k/cab0a1/32.png) [@Kyle\_Tarplee](https://forum.ansible.com/u/Kyle_Tarplee)\
**Post date:** [July 29, 2015, 3:56pm UTC](https://forum.ansible.com/t/ansible-gem-not-installing-dependencies/16614/4 "2015-07-29T15:56:52Z")

</div>

I’m having the same issue with beanstalkd\_view  
gem: name=beanstalkd\_view user\_install=no include\_dependencies=yes state=present

will not install dependencies of beanstalkd\_view.  
Ubuntu 14.04LTS and the ansible 1.9.2

---

<div class="post-metadata">

**Author:** ![Kyle\_Tarplee](https://avatars.discourse-cdn.com/v4/letter/k/cab0a1/32.png) [@Kyle\_Tarplee](https://forum.ansible.com/u/Kyle_Tarplee)\
**Post date:** [July 29, 2015, 4:12pm UTC](https://forum.ansible.com/t/ansible-gem-not-installing-dependencies/16614/5 "2015-07-29T16:12:50Z")

</div>

I just figured it out. The existence of /root/.gems that met the dependencies of beanstalkd\_view is what caused the issue. Gem thought the dependencies were met eventhough they were not when it was installing system wide in /var/lib/gems. I think the default for user\_install should be false (system wide should be the default). That is why I had packages installed in root’s home directory to begin with. Removing the directory /root/.gems solved the problem.
