All, So I''ve discovered that when running on FastCGI with Apache and the working directory for the process is actually the "public" directory under RAILS_ROOT. Is there a way to force the current working directory to be RAILS_ROOT for the FastCGI procs so that file manipulation would then be done relative to RAILS_ROOT? Or should I just make sure that all of my paths are explicitly absoulute by using #{RAILS_ROOT} in them? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
Ezra Zygmuntowicz
2006-Apr-13 21:38 UTC
[Rails] Setting CWD to be RAILS_ROOT for fastcgi/Apache
On Apr 13, 2006, at 10:03 AM, Wes Gamble wrote:> All, > > So I''ve discovered that when running on FastCGI with Apache and the > working directory for the process is actually the "public" directory > under RAILS_ROOT. > > Is there a way to force the current working directory to be RAILS_ROOT > for the FastCGI procs so that file manipulation would then be done > relative to RAILS_ROOT? > > Or should I just make sure that all of my paths are explicitly > absoulute > by using #{RAILS_ROOT} in them? > > Thanks, > Wes > > -Wes- I answered this in one of your other threads about the same thing. You have to use "#{RAILS_ROOT}/config/whatever" to access files from your rails app. *DO NOT* change the cwd as that will cause a ton of other problems that rails won''t be able to handle. Just use absolute paths or even better RAILS_ROOT + "/whatever/path" Cheers- -Ezra
Reasonably Related Threads
- Apache/fastcgi setup can''t find custom config/*.yml file!
- Routing to a static HTML file under RAILS_ROOT
- What is the working directory for fastcgi procs w/Apache 2?
- Is it possible to interpolating variables in YAML files?
- How to require a regular module into my controller?