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.


Use the Ruby constant RAILS_ENV instead, which is not necessarily set in the environment.

-- fxn