I have an standard Apache2+mod_fcgi+Rails layout. The application has a few of my own .rb files under /lib/ which I require in /config/environment.rb. When running through Mongrel/Webrick, I can do require 'lib/mylib.rb', but in the FastCGI environment (probably because the application's runtime working directory has moved from / to /public/) I all requires in /config/environment.rb fail unless I put a ../ in fron of each path.
I've tried googling on how to solve this issue but without results. The Apache2+mod_fcgi layout should be pretty common so I don't understand why this issue even came up. Should I even be requiring files in /config/environment.rb?
Might it be that because the working directory is /public/ instead of /, file uploads (using file_column) are also failing? Because right now they are. There might be a connection between those two problems.
Regards, Erik Allik