Dave M
2005-Oct-14 00:31 UTC
Detecting Webrick // determining application "root" directory
Is there a way to detect Webrick at runtime? I''ve
noticed a couple of differences between my dev
environment (Webrick) and the production environment
(Apache 2/FastCGI):
* stream must be false in send_file with webrick
* pwd is different
- Webrick: It''s where you run ruby
script/server from
- Apache: It''s the public directory
... unless someone knows of a more ruby-ish way to
determine the Rails "root" directory than using
Pathname.pwd.
Thanks.
__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/
Ezra Zygmuntowicz
2005-Oct-14 00:36 UTC
Re: Detecting Webrick // determining application "root" directory
On Oct 13, 2005, at 5:31 PM, Dave M wrote:> Is there a way to detect Webrick at runtime? I''ve > noticed a couple of differences between my dev > environment (Webrick) and the production environment > (Apache 2/FastCGI): > > * stream must be false in send_file with webrick > * pwd is different > - Webrick: It''s where you run ruby > script/server from > - Apache: It''s the public directory > > ... unless someone knows of a more ruby-ish way to > determine the Rails "root" directory than using > Pathname.pwd. >RAILS_ROOT is set to the root of your whole rails project dir. So RAILS_ROOT/public is your public dir and RAILS_ROOT/app/controllers is you controller dir. HTH- -Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732