23

I just got into rails programming and it looks like there are two programs I can use to run my project locally: rackup and foreman.

One difference I noticed is that foreman will not output some things that I would expect to see and I would see if I ran rackup instead, until I press ctrl+c to close the server. Then all those messages appear, as if they were being hidden.

Is there a reason for this? How can I get foreman to be more verbose?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
neuromancer
  • 53,769
  • 78
  • 166
  • 223
  • is the problem solved for you? Consider marking the correct answer or telling us what's missing. – oma Sep 15 '13 at 09:01

1 Answers1

51

If you are not seeing any output from your program, there is a likely chance that it is buffering stdout. Ruby buffers stdout by default.

you can fix this by putting the following code in your development.rb file:

$stdout.sync = true

http://github.com/ddollar/foreman/wiki/Missing-Output

DeanAlexRainier
  • 744
  • 1
  • 6
  • 14
  • Thanks very much! I wonder why this isn't on by default for development environments - feels like a Rails bug. – eblume Apr 17 '12 at 00:41
  • But where, exactly, does one put this line inside a Rails app? Inside config/development.rb ? – kikito Mar 06 '13 at 15:46
  • 5
    @kikito yes - inside your environment rb file. Also, neuromancer should accept this answer. – courtsimas Mar 19 '13 at 16:48