Hello Kyle,
Kyle Maxwell said the following on 2005-09-20 02:03:> It would be nice to make it gotcha-free to transition from a Webrick
> dev server to an Apache production server (or lighty).
>
> One gotcha I found is that the current directory is different. i.e.
>
> #Apache
> File.expand_path("./") #=> "/path/to/rails/public"
>
> #Webrick
> File.expand_path("./") #=> "/path/to/rails"
>
> I think this behavior should be consistent. I''d submit a patch,
but
> which way should become standard? Any has anyone else found any
> similar gotchas?
You are right, it should be consistent. In your code, use RAILS_ROOT
instead of the current directory. This is guaranteed to be consistent.
Alternatively, use __FILE__ which represents the current file, and do
a dirname on that, then navigate.
Hope that helps !
François