This error appears when same action gets called twice. There might be chances to have controller with same name twice inside app as well as plugins
In my case the error appeared while migrating from rails 2.1 to 2.3.
Application was having application.rb and application_controller.rb
And that solved problem !
2 thoughts on “Fix/Solution for NoMethodError? (undefined method `controller_name’ for nil:NilClass)”
from where you learnt NoMethodError is because of the same action called twice.
Solution Rename application.rb => application_controller.rb
I already have solution and reason for this error.