# Running Logstash from a Rails application

**URL:** <https://discuss.elastic.co/t/running-logstash-from-a-rails-application/142730>\
**Category:** Logstash\
**Created:** [August 2, 2018, 9:40am UTC](https://discuss.elastic.co/t/running-logstash-from-a-rails-application/142730 "2018-08-02T09:40:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmiSazar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amisazar/32/24885_2.png) [@AmiSazar](https://discuss.elastic.co/u/AmiSazar)\
**Post date:** [August 2, 2018, 9:40am UTC](https://discuss.elastic.co/t/running-logstash-from-a-rails-application/142730/1 "2018-08-02T09:40:03Z")

</div>

Sorry if this is a newbie question or misplaced here - I have found no information on this by searching.

I have a Rails app with its own Ruby environment. From this app, I am trying to start logstash via Ruby's system() command, i.e. executing a shell command.

But logstash fails because it seems to be run in the Gem environment of the Rails app, which differs from the global Ruby env I assume logstash needs to run.

The logstash job runs fine when started from the terminal, just not from the Rails app.

What would I need to do start logstash from a different Ruby environment than the one it expects?

Thank you for any help.

---

<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:** [August 30, 2018, 9:49am UTC](https://discuss.elastic.co/t/running-logstash-from-a-rails-application/142730/2 "2018-08-30T09:49:09Z")

</div>

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