Neeraj Kumar
2007-Jan-03 01:01 UTC
ENV[''RAILS_ENV''] get nil on *nix but works fine on windows
I have following code in my home page to check what environment the app is running in. <%=ENV[''RAILS_ENV'']%> environment I get nil from ENV[''RAILS_ENV'']. The above code works fine in windows. Any suggestion on how to get the current environment? My app is deployed with RailsPlayground.com. Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Xavier Noria
2007-Jan-03 01:05 UTC
Re: ENV[''RAILS_ENV''] get nil on *nix but works fine on windows
On Jan 3, 2007, at 2:01 AM, Neeraj Kumar wrote:> I have following code in my home page to check what environment the > app is running in. > > <%=ENV[''RAILS_ENV'']%> environment > > > I get nil from ENV[''RAILS_ENV'']. > > The above code works fine in windows. > > Any suggestion on how to get the current environment?Use the Ruby constant RAILS_ENV instead, which is not necessarily set in the environment. -- fxn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---