Forum: Ruby on Rails Setting CWD to be RAILS_ROOT for fastcgi/Apache

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-04-13 19:03
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
6076c22b65b36f5d75c30bdcfb2fda85?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-04-13 23:41
(Received via mailing list)
On Apr 13, 2006, at 10:03 AM, Wes Gamble wrote:

> 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
This topic is locked and can not be replied to.