Exception in ActionController::Base:Class for "first request only"


I am running Rails 3.0 with Ruby 1.9.2 (compiled from source) on Ubuntu 10.04.1 (Lucid Lynx) 32-bit.

About a week back I started seeing this weird exception for a particular request and that too only for the "first time", every time after I restart my server (WEBrick in this case). All subsequent requests are fine. If the same request made again, it works fine.

Here is the exception and stack trace that is printed to the console : http://pastie.org/2110523

To me it appears like parts of the actionpack gem are not being loaded properly and hence the no_method_error. I could not figure out anything more. Any help in understanding the cause of the error and a way to solve it is greatly appreciated.

Here are some things that I tried (the results of which made absolutely no sense to me) :

The request is http://localhost/user

This is a simple query (AJAX request if that matters) to check if the user is logged in. If the user is indeed logged in then it returns some basic user info or it returns an error status code if not. When the website home page is loaded, this is the first request to the rails application (after several static files have been served by Nginx).

Setup 1 -- I have NginX in front of WEBrick. NginX is listening on port 80 and forwarding requests to WEBrick ====== listening on port 3000

Experiment 1