# Developing a filter plugin which depends on ruby gem

**URL:** <https://discuss.elastic.co/t/developing-a-filter-plugin-which-depends-on-ruby-gem/118075>\
**Category:** Logstash\
**Created:** [February 1, 2018, 4:36pm UTC](https://discuss.elastic.co/t/developing-a-filter-plugin-which-depends-on-ruby-gem/118075 "2018-02-01T16:36:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulborile](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paulborile/32/27261_2.png) [@paulborile](https://discuss.elastic.co/u/paulborile)\
**Post date:** [February 1, 2018, 4:36pm UTC](https://discuss.elastic.co/t/developing-a-filter-plugin-which-depends-on-ruby-gem/118075/1 "2018-02-01T16:36:55Z")

</div>

Hi,

I'm developing a filter plugin which uses an external ruby gem (that requires ffi). The plugin compiles and tests ok (with bundle exec rspec) but when I run :

```
bin/logstash-plugin install logstash-filter-wurfldevicedetection/logstash-filter-wurfldevicedetection-0.1.0.gem

```

I get :

```
Validating logstash-filter-wurfldevicedetection/logstash-filter-wurfldevicedetection-0.1.0.gem
Installing logstash-filter-wurfldevicedetection
Plugin version conflict, aborting
ERROR: Installation Aborted, message: Bundler could not find compatible versions for gem "wurfl":
  In Gemfile:
    logstash-filter-wurfldevicedetection (= 0.1.0) java depends on
      wurfl (= 0.2.4) java
Could not find gem 'wurfl (= 0.2.4) java', which is required by gem 'logstash-filter-wurfldevicedetection (= 0.1.0) java', in any of the sources.

```

the gem is already installed :

```
   $ jruby -S gem list | grep wurfl
   wurfl (0.2.4)

```

Looks like it is looking a java version of the dependency : is this correct ? How can I tell logstash-plugin not to look for java version of dependency ?  
This is the gemspec for the plugin :

```
Gem::Specification.new do |s|
  s.name = 'logstash-filter-wurfldevicedetection'
  s.version = '0.1.0'
  s.licenses = ['Apache-2.0']
  s.summary = 'Detect devices from useragent and prints properties.'
  s.description = 'Detect devices from useragent and prints properties.'
  s.homepage = 'http://www.scientiamobile.com.'
  s.authors = ['Paul Borile']
  s.email = 'paul.borile@gmail.com'
  s.require_paths = ['lib']

  # Files
  s.files = Dir['lib/ **/*','spec/** /*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
   # Tests
  s.test_files = s.files.grep(%r{^(test|spec|features)/})

  # Special flag to let us know this is actually a logstash plugin
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }

  # Gem dependencies
  s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
  s.add_runtime_dependency 'wurfl', '0.2.4'
  s.add_development_dependency 'logstash-devutils'
end

```

I'm a logstash/ruby newbie so forgive if I'm missing any basic stuff.  
Any help is welcome, thanks in advance  
-Paul

---

<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:** [March 1, 2018, 4:37pm UTC](https://discuss.elastic.co/t/developing-a-filter-plugin-which-depends-on-ruby-gem/118075/2 "2018-03-01T16:37:12Z")

</div>

Closed on March 1, 2018, 4:37pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
