Developing a filter plugin which depends on ruby gem

(Paul Stephen Borile) #1


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 : do |s|          = '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      = ''
  s.authors       = ['Paul Borile']         = ''
  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'

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

(system) #2

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