Rails WEBrick does not write log to terminal (stdout)

WEBrick usually writes its output to both development.log and stdout. However, he suddenly stopped doing it and he didn't write to stdout. All we get is

Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

      

and then nothing. development.log seems to be spelled correctly.

This is a project specific issue as it happens to all members of our team on different computers. On the other hand, if I create another Rails project (and copy the Gemfile and Gemfile.lock to make sure I have the same stones), I get normal output on the terminal.

This is a big problem because, among other things, it prevents us from using pry or ruby-debug since I don't have access to the process at the breakpoint.

We are using Ruby ruby-1.9.3-p194, Rails 3.2.8 and WEBrick 1.3.1. In case it matters, we're all on the Macs (Mountain Lion).

Any ideas what could be causing this and how to solve it? We need stdout to return! thank

+3


source to share


2 answers


It turned out that someone had added these three lines to config.ru

log = File.new("console.log", "a+")
$stdout.reopen(log)
$stderr.reopen(log)

      



It was very painful to figure this out, so of course, don't do it.

+1


source


If you are using pry-remote you should be fine.



0


source







All Articles