Passenger: internal server error Passenger: internal server error ruby ruby

Passenger: internal server error


I found the answer what is causing it in my case. In my config.ru I was redirecting STDOUT like this:

log = File.new("logs/std.log", "a+")STDOUT.reopen(log)

Removing the redirect into the log and it starts up again.

Looks like passenger needs STDOUT to detect a working "preloader".


Edit: I'm currently using the following solution to redirect the log into a file and keep passenger happy (basically just duplicating stdout into the log file and not redirecting):

log = File.new("logs/std.log", "a+")def STDOUT.write string    log.write string    superendSTDOUT.sync = true


In case the above doesn't solve it for you, I had the exact same error message with a different cause.

In my case, we were using an external database server and that had gone down.

Bringing the external db server back up fixed the issue.

But before we solved this, we spent a bunch of time thinking about recompiling passenger, etc.

Hope this note saves someone some time.