Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails + foreman + worker hangs server

On my local machine I'm trying to start my rails app and delayed job worker using Foreman. My Procfile looks like this:

web: bundle exec rails server -p $PORT
worker: bundle exec rake jobs:work

When I start foreman only the first two web requests get executed. With the third request the server hangs. The first request is outputted in the console, the second isn't.

If I leave out the worker in my Procfile the server is running just fine and is outputting everything to the console. Also when I start the rails server and worker without Foreman everything is working fine.

So it looks like there's an issue with Foreman. I'm guessing it's a problem with Foreman not outputting anything to the console after the first request and therefore the buffer doesn't get flushed. I've searched other posts and as a result added STDOUT.sync = true to my development.rb but without any success.

Does anybody have a clue? Thanks!

like image 951
smek Avatar asked Jul 06 '12 09:07

smek


1 Answers

UPDATE: Tracked and resolved here:

https://github.com/ddollar/foreman/issues/244

TL;DR: Install the gem, don't use foreman.pkg


I'm facing the same problem.

Here's a link to the question I've asked on stackoverflow. @smek, if you found an answer, please reply!

like image 170
Vighnesh Avatar answered Sep 29 '22 22:09

Vighnesh