Confusing Rails Error Message

Posted by patjoyce
Sep 18, 2007

ArgumentError: Admin is not missing constant UsersController!
    method load_missing_constant in dependencies.rb at line 240
    method const_missing in dependencies.rb at line 452
    method send in dependencies.rb at line 470
    method const_missing in dependencies.rb at line 470
    method setup_without_fixtures in users_controller_test.rb at line 11
    method setup in fixtures.rb at line 576

Note to self: the above error message normally means that you are missing the scope prefix and the :: operator. So in the above example the error would be fixed by prepending “Admin::” to the reference to the class “UsersController” on line 11 of users_controller_test.rb.

Comments

Leave a response

  1. Alex G October 01, 2007 @ 12:26 PM

    Thank you! That did it for me. What a bullshit of an error.

Comment