I get the following error when multiple versions of Rack are
present, specifically when Rack 1.0 is present:
undefined method 'new' for "Rack::Lock":String (NoMethodError)
I think this has to do with how Rails is loading the Rack
dependency. For some reason, when Rack 1.0 and 0.9.1 are both
installed, Rails uses Rack 0.9.1 instead of either the installed
Rack 1.0 or the bundled Rack 1.0 in ActionPack.
I tried to do some debugging myself to see if I could find the
actual code that causes this to take place, but alas, Rails code is
a bit beyond my Ruby knowledge.
What I did find, however, is that because Rack 0.9 is being used
instead of Rack 1.0, the klass method in
ActionController::MiddlewareStack::Middleware#klass
rescues the resulting NameError when attempting to constantize
"Rack::Lock". Because the rescue code in the #klass just returns
the current value of @klass, and because that value is the string
"Rack::Lock" at the time, the "new" method is undefined, resulting
in the above error.
If it helps, I'm using Passenger in my development environment
which is where I see this taking place.
Dave Giunta