title: execute ruby as pipeline input for logstash
body: <p>Logstash allows <a href="https://www.elastic.co/guide/en/logstash/current/plugins-inputs-exec.html">executing arbitrary commands</a> as inputs for a pipeline.
  Here is my example pipeline:</p>
  
  <pre><code>input {
    exec {
      command =&gt; '/usr/bin/ruby -e "puts RUBY_VERSION"'
      interval =&gt; 10
    }
  }
  
  output {
    stdout { codec =&gt; rubydebug }
  }
  </code></pre>
  
  <p>With this I get the following error:</p>
  
  <pre><code>/opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:328:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'logstash-core (= 2.4.0) ruby' in any of the gem sources listed in your Gemfile or installed on this machine. (Bundler::GemNotFound)
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:307:in `each'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:307:in `verify_gemfile_dependencies_are_found!'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:199:in `start'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:182:in `resolve'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:192:in `resolve'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:132:in `specs'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:177:in `specs_for'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:166:in `requested_specs'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/environment.rb:18:in `requested_specs'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/runtime.rb:13:in `setup'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler.rb:122:in `setup'
          from /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/setup.rb:18:in `&lt;top (required)&gt;'
          from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
          from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  </code></pre>
  
  <p>I also tried running logstash's very own JRuby inside the exec like this</p>
  
  <pre><code>input {
    exec {
      command =&gt; '/opt/logstash/vendor/jruby/bin/jruby -e "puts RUBY_VERSION"'
      interval =&gt; 10
    }
  }
  
  output {
    stdout { codec =&gt; rubydebug }
  }
  </code></pre>
  
  <p>and it creates another Bundler error:</p>
  
  <pre><code>Bundler::GemNotFound: Could not find gem 'ci_reporter_rspec (= 1.0.0) java' in any of the gem sources listed in your Gemfile or installed on this machine.
    verify_gemfile_dependencies_are_found! at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:328
                                      each at org/jruby/RubyArray.java:1613
    verify_gemfile_dependencies_are_found! at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:307
                                     start at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:199
                                   resolve at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/resolver.rb:182
                                   resolve at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:192
                                     specs at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:132
                                 specs_for at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:177
                           requested_specs at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/definition.rb:166
                           requested_specs at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/environment.rb:18
                                     setup at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/runtime.rb:13
                                     setup at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler.rb:122
                                    (root) at /opt/logstash/vendor/bundle/jruby/1.9/gems/bundler-1.9.10/lib/bundler/setup.rb:18
                                   require at org/jruby/RubyKernel.java:1040
                                    (root) at /opt/logstash/vendor/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
  </code></pre>
  
  <p>Logstash keeps running and the pipeline executes every 10 seconds but the message is always empty. Trying to execute other commands like <code>echo "hello"</code> works without problems.</p>
  
  <p>Running on logstash 2.4.0, openjdk version "1.8.0_102", system ruby is MRI 2.3.1 on Archlinux ARM. </p>
  
  <p>Any ideas?</p>