# Unable to find plugins when unit testing using rspec on windows 10

**URL:** <https://discuss.elastic.co/t/unable-to-find-plugins-when-unit-testing-using-rspec-on-windows-10/57230>\
**Category:** Logstash\
**Created:** [August 4, 2016, 2:36pm UTC](https://discuss.elastic.co/t/unable-to-find-plugins-when-unit-testing-using-rspec-on-windows-10/57230 "2016-08-04T14:36:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwerge](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@cwerge](https://discuss.elastic.co/u/cwerge)\
**Post date:** [August 4, 2016, 2:36pm UTC](https://discuss.elastic.co/t/unable-to-find-plugins-when-unit-testing-using-rspec-on-windows-10/57230/1 "2016-08-04T14:36:05Z")

</div>

Hi

Using logstash 2.3.1, after having run the "logstash-plugin install --development", the gemfile is updated and i can find the plugins manually.

The top of the ruby file containing the test contain the following lines:

```
require "logstash/devutils/rspec/spec_helper"
require "logstash/filters/multiline"
require "logstash/filters/grok"
require "logstash/filters/date"
require "logstash/filters/mutate"
require 'rspec/expectations'
...

```

When running the test i get the following error:

`LoadError: no such file to load -- logstash/devutils/rspec/spec_helper`

I have confirmed that the spec\_helper exists both in the filestructure and the gemfile. Furthermore, it works on windows 8 with no problem.

My assumption at this point is, that an environmental value doesn't get set properly when installing the plugins when using windows 10.

I hope someone can help me. If more information is needed i will happily supply.

Best regards  
Christoffer

---

<div class="post-metadata">

**Author:** ![cwerge](https://avatars.discourse-cdn.com/v4/letter/c/9de0a6/32.png) [@cwerge](https://discuss.elastic.co/u/cwerge)\
**Post date:** [August 5, 2016, 10:40am UTC](https://discuss.elastic.co/t/unable-to-find-plugins-when-unit-testing-using-rspec-on-windows-10/57230/2 "2016-08-05T10:40:34Z")

</div>

Hello

I found a solution. Apparently the lookup paths for gems did not get set properly.

By adding the following three lines at the top of the test file (before requires), the path was set and i could access the logstash-devutils and subsequent plugins

```
$LOAD_PATH.unshift(File.expand_path(File.join( __FILE__ , "..","..","..","lib" )))
require "bootstrap/environment"
Gem.use_paths(LogStash::Environment.logstash_gem_home)
...

```

The load path assumes that the test file is at

`<logstash-folder>/bin/<test-folder>/`

if the test file is somewhere else the LOAD\_PATH must be set to point to the /lib/ folder

I hope this helps someone

Best regards  
Christoffer

---

<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:** [July 6, 2017, 4:44am UTC](https://discuss.elastic.co/t/unable-to-find-plugins-when-unit-testing-using-rspec-on-windows-10/57230/3 "2017-07-06T04:44:38Z")

</div>


