#33 ✓resolved
James McKinney

ActionView::TemplateError: undefined method `acts_as_authentic_config'

Reported by James McKinney | January 30th, 2009 @ 11:54 AM

After deploying a new version of my Rails (2.1.2) project with Capistrano (2.5.3) to my production server running Thin (1.0.0) and Nginx (0.6.32), I sometimes get the following behavior.

Every couple requests, my application will raise this error: "ActionView::TemplateError: undefined method `acts_as_authentic_config'"

If I restart Thin (one or more times), I will eventually stop getting these errors. I'm using authlogic as a plugin in vendor/plugins.

I'm using revision dc03026a6814b05b6f5cd486072a41cd604010c7 of authlogic.

Any idea what might work to avoid these errors?

Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson January 30th, 2009 @ 12:02 PM

    • State changed from “new” to “open”

    Do you have a backtrace that I can look at?

  • Ben Johnson

    Ben Johnson January 30th, 2009 @ 12:26 PM

    When you updated rails did you run:

    rake rails:update

    Because some configuration needs to change and a lot of changes have been made regarding caching classes, etc. This is a strange error that I have yet to see and it looks like its a caching problem.

  • Ben Johnson

    Ben Johnson January 30th, 2009 @ 12:38 PM

    If your application is not active, you might try disabling the cache_classes option in your environment for production. Just to see if that gets rid of the problem. If so then there is an issue when your caching. What is weird to me is that "login_field" is a valid method, yet acts_as_authentic_config is not. There is a little trickiness to defining that method. It uses the following:

    def meta_def(name, &block)
                (class << self; self; end).instance_eval { define_method name, &block }
    meta_def :acts_as_authentic_config do

    meta_def is in ActiveSupport, but I add it in for backwards compatibility, because it didn't show up until later. Play around with meta_def and see if that is working properly. Regardless, if the classes are being cached the acts_as_authentic should only be ran once and it seems like its working the first time around.

  • Ben Johnson

    Ben Johnson February 4th, 2009 @ 02:45 PM

    • State changed from “open” to “resolved”

    Sounds good, yes there were quite a few caching changes made. I have yet to get this error or hear about it, so I am going to assume this is resolved. Thanks for the update.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.

People watching this ticket