Rails 2.3.15 The system may be run using mongrel or apache/passenger. Some functions are not supported in mongrel 1.1.5 but work in apache/passengertherefore I want to know what server is being used so I canalter behavior as needed. How can I determine in a controller which server is serving the system? Thanks Norm -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/51D65000.7000704%40earthlink.net. For more options, visit https://groups.google.com/groups/opt_out.
I suppose you could check the environment from within the relevant function. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8c02e06ebca8c8eee24241dfff744857%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
On Friday, July 5, 2013 5:48:00 AM UTC+1, Norm wrote:> > Rails 2.3.15 > The system may be run using mongrel or apache/passenger. Some functions > are not supported in mongrel 1.1.5 but work in apache/passenger therefore > I want to know what server is being used so I can alter behavior as > needed. > > How can I determine in a controller which server is serving the system? > >Pretty crude but you could check defined?(PhusionPassenger) Fred> Thanks > Norm >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c941a365-9f77-4c7e-95d8-7607c07ae362%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Norm Scherer
2013-Jul-06 01:42 UTC
Re: Re: How can I determine which server is used (Solved)
Thanks Frederick and Joel. Turns out SERVER_SOFTWARE is defined as "Apache/2.2.14 (Ubuntu)" in the environment so I can use that and also PhusionPassenger is defined when running under passenger so that would work also. Both are fairly crude but they work and that is what I need. I would prefer to know mongrel is running but that does not seem as easy and this will work. Norm On 07/05/2013 07:40 AM, Frederick Cheung wrote:> > > On Friday, July 5, 2013 5:48:00 AM UTC+1, Norm wrote: > > Rails 2.3.15 > The system may be run using mongrel or apache/passenger. Some > functions are not supported in mongrel 1.1.5 but work in > apache/passengertherefore I want to know what server is being used > so I canalter behavior as needed. > > How can I determine in a controller which server is serving the > system? > > > Pretty crude but you could check defined?(PhusionPassenger) > > Fred > > Thanks > Norm > > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/c941a365-9f77-4c7e-95d8-7607c07ae362%40googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/51D77605.7050109%40earthlink.net. For more options, visit https://groups.google.com/groups/opt_out.