Jason Hsu, Rubyist
2013-Sep-11 16:25 UTC
Why does Rails debug information shows up in production?
I recently upgraded Bargain Stock Funds (http://www.bargainstockfunds.com) and Doppler Value Investing (http://www.dopplervalueinvesting.com) from Rails 3.2 to Rails 4.0. I''ve noticed that the debug information is on the production web site even though the app/views/layouts/application.html.erb file has the line "<%= debug(params) if Rails.env.development? %>". This SHOULD suppress the debug information on each page in the production environment, but it doesn''t seem to be working. (The technical tabs on both web sites contain the links to the source code.) Commenting out the "<%= debug(params) if Rails.env.development? %>" line does remove the debug information, but I need to retain it in the development environment. Thus, I believe that my production environment is being mistaken for the development environment. My questions: 1. How do I confirm whether I''m in the development or production environment? My assumptions don''t seem to be holding up. 2. What is the mechanism that specifies the development or production environment? -- 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/8b16c0e3-0193-474a-ab7f-cc942ef6def0%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Tamara Temple
2013-Sep-11 16:31 UTC
Re: Why does Rails debug information shows up in production?
On Sep 11, 2013, at 11:25 AM, "Jason Hsu, Rubyist" <jhsu802701-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I recently upgraded Bargain Stock Funds (http://www.bargainstockfunds.com) and Doppler Value Investing (http://www.dopplervalueinvesting.com) from Rails 3.2 to Rails 4.0. > > I''ve noticed that the debug information is on the production web site even though the app/views/layouts/application.html.erb file has the line "<%= debug(params) if Rails.env.development? %>". This SHOULD suppress the debug information on each page in the production environment, but it doesn''t seem to be working. (The technical tabs on both web sites contain the links to the source code.)This tells me you are not running with RAILS_ENV=''production''. Instead, it is either not set (defaults to ''development'') or is set to ''development''.> > Commenting out the "<%= debug(params) if Rails.env.development? %>" line does remove the debug information, but I need to retain it in the development environment. Thus, I believe that my production environment is being mistaken for the development environment. > > My questions: > 1. How do I confirm whether I''m in the development or production environment? My assumptions don''t seem to be holding up.You check Rails.env or ENV[''RAILS_ENV'']> 2. What is the mechanism that specifies the development or production environment?The RAILS_ENV environment variable is set to the environment you want loaded. If it is not set or empty, it defaults to ''development''.> > -- > 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/8b16c0e3-0193-474a-ab7f-cc942ef6def0%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/CD57E77C-3940-4269-8A39-9A8D5C985793%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Jason Hsu, Rubyist
2013-Sep-11 16:43 UTC
Re: Why does Rails debug information shows up in production?
I''ve done some troubleshooting and have confirmed that what should be my production environment is being seen by Rails as the development environment instead. What is the proper way to make sure that my production environment is actually seen by Rails as the production environment? Please keep in mind that I''m in Rails 4.0 and not 3.2 now. -- 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/7ccd029a-7150-483c-bfc7-029fb248839b%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Jason Hsu, Rubyist
2013-Sep-12 05:33 UTC
Re: Why does Rails debug information shows up in production?
I found out what the problem was. The nginx.conf file in the production environment (which is automatically generated when I create the Rails 4.0 app in WebFaction) specified the development environment instead. I changed it to specify the production environment. Now the production environment actually behaves like the production environment. -- 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/f493c694-1901-4462-910f-4032c7e8d6e7%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.