ruby on rails - uninitialized constant ActionView::CompiledTemplates::RAILS_ENV -


i added application.html.erb file:

<%= render :partial => 'layouts/ga' if rails_env == 'production' %> 

and error uninitialized constant actionview::compiledtemplates::rails_env on exact line.

when take if rails_env == 'production' off, error goes away isn't suppose work fine? error tries tell me?

rails_env should key in environment variable array env. try:

<%= render :partial => 'layouts/ga' if env["rails_env"] == 'production' %> 

or,

<%= render :partial => 'layouts/ga' if rails.env.production? %> 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -