Ruby rails - using 'p' to print causes errors

When I use the standard print mechanism for Rails, .fcgi and .cgi throw errors. When run from the webrick server, no issues. Webrick writes it to the console, while .cgi writes it to standard out.

Any ideas?

I’m about to switch my code to use the logger instead of “p”.

Well, that’s definitely the problem.

During development I made use of puts and p (the stdout printing functions) to output to the console that WebBrick runs in for general tracing and debugging.

However, this goes right to the browser when using CGI and FCGI. So, don’t do it. Use the Logger.

But, getting around it is possible: