# Input plugin development : How to run ruby file standalone before generating gem

**URL:** <https://discuss.elastic.co/t/input-plugin-development-how-to-run-ruby-file-standalone-before-generating-gem/209991>\
**Category:** Logstash\
**Created:** [November 29, 2019, 4:54pm UTC](https://discuss.elastic.co/t/input-plugin-development-how-to-run-ruby-file-standalone-before-generating-gem/209991 "2019-11-29T16:54:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [November 29, 2019, 4:54pm UTC](https://discuss.elastic.co/t/input-plugin-development-how-to-run-ruby-file-standalone-before-generating-gem/209991/1 "2019-11-29T16:54:22Z")

</div>

Hi All

i am developing a input plugin, i am following the below steps

1. Generated the full file tree structure from online input plugin generation as mentioned [here](https://www.elastic.co/guide/en/logstash/current/plugin-generator.html)
2. Installed rbenv
3. Installed jruby
4. gem install bundler
5. cd to the location of the plugin folder
6. installed " bundle install", this installs successfully (2 Gemfile dependencies, 57 gems)
7. Under file flow.rb

> lib  
> │ └── logstash  
> │ └── inputs  
> │ └── flow.rb

In the flow.rb, i declared the two requires like

> require "logstash/inputs/base"  
> require "logstash/namespace"

When i run the ruby file individually flow.rb, i get error like cannot load file base.rb  
Since i have already installed all the logstash core ruby gems, it is not picking up the logstash-core ruby files

While building the gems, i set my dependency in gem file as

> ```
> source 'https://rubygems.org'
> gemspec
> 
> ```

My problem is i do not want to create a final logstash gem and load into logstash as plugin.  
Before doing so i want to make sure my flow.rb file is correct. For that i am running flow.rb manually to test my code.

But i am getting errors because of requirement statements. How to make sure that i call all the dependencies and gems to my development environment in one go and use my flow.rb to do the overall development.

Basically i do not need errors by require statements which is declared on top

Thanks

---

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [November 30, 2019, 11:33am UTC](https://discuss.elastic.co/t/input-plugin-development-how-to-run-ruby-file-standalone-before-generating-gem/209991/2 "2019-11-30T11:33:20Z")

</div>

Do anyone has idea on my above question? Its just lack of documentation.

---

<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:** [December 28, 2019, 11:33am UTC](https://discuss.elastic.co/t/input-plugin-development-how-to-run-ruby-file-standalone-before-generating-gem/209991/3 "2019-12-28T11:33:29Z")

</div>

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