# Issues installing custom plugin

**URL:** <https://discuss.elastic.co/t/issues-installing-custom-plugin/36908>\
**Category:** Logstash\
**Created:** [December 10, 2015, 7:37pm UTC](https://discuss.elastic.co/t/issues-installing-custom-plugin/36908 "2015-12-10T19:37:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Russ\_Lavoie](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@Russ\_Lavoie](https://discuss.elastic.co/u/Russ_Lavoie)\
**Post date:** [December 10, 2015, 7:37pm UTC](https://discuss.elastic.co/t/issues-installing-custom-plugin/36908/1 "2015-12-10T19:37:24Z")

</div>

I am having issues installing a custom plugin and it is driving me nuts.

Environment  
Ubuntu 12.0.4 64 Bit  
Installed Logstash via provided deb package (1.5.2)

Followed the link [https://www.elastic.co/guide/en/logstash/1.5/\_how\_to\_write\_a\_logstash\_filter\_plugin.html](https://www.elastic.co/guide/en/logstash/1.5/_how_to_write_a_logstash_filter_plugin.html) to the "T"

I needed support for memcached, json and mysql so I added the following to my logstash-filter-enrichment.gemspec and the Gemfile

gemspec  
`s.add_runtime_dependency "memcached" s.add_runtime_dependency "json" s.add_runtime_dependency "mysql2"`

Gemfile  
`gem "memcached" gem "json" gem "mysql2"`

I am able to build the gem with no issue.  
`gem build logstash-filter-enrichment.gemspec Successfully built RubyGem Name: logstash-filter-enrichment Version: 0.0.1 File: logstash-filter-enrichment-0.0.1.gem`

The issue is trying to install the gem.  
`/opt/logstash/bin/plugin install --no-verify logstash-filter-enrichment-0.0.1.gem Installing logstash-filter-enrichment Error Bundler::InstallError, retrying 1/10 An error occurred while installing memcached (1.8.0), and Bundler cannot continue. Make sure that`gem install memcached -v '1.8.0'`succeeds before bundling.`  
But when I try `gem install memcached -v '1.8.0'`It installs with no issue  
`gem install memcached -v '1.8.0' Building native extensions. This could take a while... Successfully installed memcached-1.8.0 1 gem installed Installing ri documentation for memcached-1.8.0... Installing RDoc documentation for memcached-1.8.0...`  
So I thought, well... Lets to upgrade to logstash 2.1 and see how that rolls.

Same issue, but I followed the below instead [https://www.elastic.co/guide/en/logstash/current/\_how\_to\_write\_a\_logstash\_filter\_plugin.html](https://www.elastic.co/guide/en/logstash/current/_how_to_write_a_logstash_filter_plugin.html)

So for my own testing I walked into the plugin directory and ran `bundle install` and it kicks back the following  
`bundle install Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Updating git://github.com/elastic/logstash.git Fetching gem metadata from https://rubygems.org/........... Fetching version metadata from https://rubygems.org/... Fetching dependency metadata from https://rubygems.org/.. Could not find gem 'logstash (>= 0) ruby' in git://github.com/elastic/logstash.git (at 2.1). Source does not contain any versions of 'logstash (>= 0) ruby'`

My Gemfile for my plugin has the following entry per the documentation  
`gem "logstash", :github => "elastic/logstash", :branch => "2.1"`

That stopped me from going further.

But for kicks I commented out the logstash entries in the Gemfile and gemspec file and tried again

`bundle install Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Resolving dependencies... Using json 1.8.3 Using memcached 1.8.0 Using mysql2 0.4.2 Using logstash-filter-enrichment 0.0.1 from source at . Using bundler 1.10.6 Bundle complete! 4 Gemfile dependencies, 5 gems now installed. Use`bundle show [gemname]`to see where a bundled gem is installed.`

Thanks for your help all 😄

---

<div class="post-metadata">

**Author:** ![Russ\_Lavoie](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@Russ\_Lavoie](https://discuss.elastic.co/u/Russ_Lavoie)\
**Post date:** [December 21, 2015, 9:54pm UTC](https://discuss.elastic.co/t/issues-installing-custom-plugin/36908/2 "2015-12-21T21:54:42Z")

</div>

Found the issue it seems. Since memcached and mysql2 use C based headers to install, I switched the mysql2 gem to use [ruby-mysql](https://rubygems.org/gems/ruby-mysql) and the memcached gem to use [dalli](https://rubygems.org/gems/dalli). Looks like we are in the clear now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:17am UTC](https://discuss.elastic.co/t/issues-installing-custom-plugin/36908/3 "2017-07-06T05:17:39Z")

</div>


