logstash-plugins / logstash-filter-kv

Apache License 2.0
17 stars 42 forks source link

Dependencies Issues while running the Specs #64

Closed prakash1243 closed 5 years ago

prakash1243 commented 6 years ago

I cloned the repository to my local; having Jruby installed, and bundle install was successful. When I run ny of the specs, I get the dependcies issues:

**RuntimeError: you might need to reinstall the gem which depends on the missing jar or in case there is Jars.lock then resolve the jars with lock_jars command

no such file to load -- org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21 (LoadError)**

I tried with few other repositories I see the same error message. Could you please let me know how do I resolve the issue.

Jruby Version - jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 Java HotSpot(TM) 64-Bit Server VM 25.11 1-b14 on 1.8.0_111-b14 +jit [mswin32-x86_64]

Ruby Version - ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

colinsurprenant commented 6 years ago

@prakash1243 Lastest logstash uses JRuby 9.1.13.0. I suggest you install that version.

Using this from the plugin root dir should work:

$ rm -rf vendor Gemfile.lock
$ bundle install
$ bundle exec rspec

If you run into a problem like

Gem::LoadError: You have already activated jar-dependencies 0.3.10, but your Gemfile requires jar-dependencies 0.3.12. Since jar-dependencies is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports jar-dependencies as a default gem.

As a temporary fix to get your test running you can add this in logstash-filter-kv.gemspec

s.add_runtime_dependency "jar-dependencies", "=0.3.10"

and redo

$ rm -rf vendor Gemfile.lock
$ bundle install
$ bundle exec rspec

Let me know how that works for you.

colinsurprenant commented 5 years ago

I will go ahead and close this issue; @prakash1243 please feel free to reopen if needed.