[Mongrel] Errno::EBADF (Bad file descriptor)

Jan Svitok jan.svitok at gmail.com
Mon Nov 6 14:57:50 EST 2006

On 11/6/06, Jan Svitok <jan.svitok at gmail.com> wrote:
> On 11/6/06, Justin Johnson <justinjohnson at gmail.com> wrote:
> > Does anyone have any advice on how to resolve the problem reported at
> > http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145
> You are running a service that does not have STDIN, STDOUT nor STDERR,
> therefore you cannot write to them. If you want to debug, I suggest
> opening a file (local file, service doesn't 'see' substs or network
> drives) and writing to that. Maybe Logger or Log4r would be useful.
> Another possibility is to use OutputDebugString and DbgView[1], but
> I'm not sure if service is allowed to call it.
> require 'Win32API'
> module Windows
>    module Debug
>       OutputDebugString              = Win32API.new('kernel32',
> 'OutputDebugStringA', 'P', 'V')
>       def OutputDebugString(message)
>          OutputDebugString.call(message)
>       end
>    end
> end
> [1] http://www.sysinternals.com/Utilities/DebugView.html

Yeah, and while we are at it, few more hints:

- check Rails' debugging facilities, AWDWR sections 13.6 and 13.7.
Basically you can do logger.warn "message", logger.info "message",
logger.error "message", logger.fatal "message" anywhere in your rails
code. The "message" will go into respective log (development.log,...)

- see also http://api.rubyonrails.com/classes/ActionView/Helpers/DebugHelper.html
- run your code without service
- look around rubyonrails.com for more debugging possibilities

More information about the Mongrel-users mailing list