Forum: Ruby on Rails one more try - ENV and FastCGI

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.
B78b4458991fb48b4cc0e9defb488730?d=identicon&s=25 sfmcfar (Guest)
on 2006-04-28 00:43
(Received via mailing list)
Hi,

I'm desperate, so I thought I'd try one more time in the hopes of
getting a
different audience.  Basically. it boils down to this.  Using CGI, the
ENV
hash is populated and is accessible from a model script.  Using FastCGI,
the
ENV hash is empty.  Can anyone explain how I can fix this?

Thanks,

Stan Mcfarland
--
View this message in context:
http://www.nabble.com/one-more-try---ENV-and-FastC...
Sent from the RubyOnRails Users forum at Nabble.com.
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-04-28 02:35
(Received via mailing list)
On Apr 27, 2006, at 3:39 PM, sfmcfar wrote:
> I'm desperate, so I thought I'd try one more time in the hopes of
> getting a
> different audience.  Basically. it boils down to this.  Using CGI,
> the ENV
> hash is populated and is accessible from a model script.  Using
> FastCGI, the
> ENV hash is empty.  Can anyone explain how I can fix this?

Perhaps there's no ENV when FastCGI is started?

I haven't done any ENV based configuration in Rails, though I used to
be a
big fan in mod_perl days. If you're using Apache, then you
specifically need
to declare which environment vars to pass via the PassEnv
configuration option.

--
-- Tom Mornini
B78b4458991fb48b4cc0e9defb488730?d=identicon&s=25 sfmcfar (Guest)
on 2006-04-28 04:15
(Received via mailing list)
Well,

FastCGI has a parameter called -initial-env which is suypposed to allow
you
set the environmental variables of interest, but I can't seem to make it
work.  I might need to revisit, though.  Thanks for the reminder.

-stan
--
View this message in context:
http://www.nabble.com/one-more-try---ENV-and-FastC...
Sent from the RubyOnRails Users forum at Nabble.com.
A0ed1bbfe42f4f87e6db0a16706246e2?d=identicon&s=25 Michael Greenly (mgreenly)
on 2006-04-28 14:20
sfmcfar wrote:
> Well,
>
> FastCGI has a parameter called -initial-env which is suypposed to allow
> you
> set the environmental variables of interest, but I can't seem to make it
> work.  I might need to revisit, though.  Thanks for the reminder.
>
> -stan
> --
> View this message in context:
> http://www.nabble.com/one-more-try---ENV-and-FastC...
> Sent from the RubyOnRails Users forum at Nabble.com.

Here's an entry from a running apache config file setting up my fastcgi
(if it helps?)

FastCgiServer "C:/WebApps/_premier/public/dispatch.fcgi" -idle-timeout
120 -processes 2 \
-initial-env
PATH="C:/PROGR~1/ruby/bin;C:/PROGR~1/MYSQL/MySQLS~1.0/bin;c:/windows/system32;c:/windows;"
\
-initial-env RUBYOPT=rubygems \
-initial-env RAILS_ENV=development
B78b4458991fb48b4cc0e9defb488730?d=identicon&s=25 sfmcfar (Guest)
on 2006-04-28 16:26
(Received via mailing list)
And the ENV hash contains the variables you've set with initial-env?  I
can
get at these variables through
the request.env object, but I need to access them in a model script, and
the
request object isn't available
to the model.

Thanks,

-stan

--
View this message in context:
http://www.nabble.com/one-more-try---ENV-and-FastC...
Sent from the RubyOnRails Users forum at Nabble.com.
B78b4458991fb48b4cc0e9defb488730?d=identicon&s=25 sfmcfar (Guest)
on 2006-04-28 16:36
(Received via mailing list)
And the ENV hash contains the variables you've set with initial-env?  I
can
get at these variables through
the request.env object, but I need to access them in a model script, and
the
request object isn't available
to the model.

Thanks,

-stan

--
View this message in context:
http://www.nabble.com/one-more-try---ENV-and-FastC...
Sent from the RubyOnRails Users forum at Nabble.com.
This topic is locked and can not be replied to.