Troubles getting custom input plugin with external gem working

I am building a custom plug-in with a connection to the Google API. To do this I have included the google-api-client in my gemspec file; s.add_runtime_dependency 'google-api-client'.
When I want to build and test my plug-in I fail at installing the plug-in.
The following commands work fine;
jruby -S bundle install
jruby -S gem build logstash-input-googleanalytics
The gem file is created and then I want to install the plugin:
sudo -E ./logstash-plugin install /tmp/logstash-input-googleanalytics/logst
ash-input-googleanalytics-1.0.0.gem

I recieve the following error:
Error Bundler::InstallError, retrying 1/10
An error occurred while installing google-api-client (0.9.11), and Bundler cannot continue.
Make sure that gem install google-api-client -v '0.9.11' succeeds before bundling.

The problem with this error is that manually installing this gem works fine. Only logstash is not able to do is properly.

Anyone an idea here? Thanks!

This issue has been fixed! Building the plugin is now done via jruby 9.x and installing the gem is done via the jruby which is shipped with LogStash.

All better now, case closed :slight_smile: