Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

undefined method `password' #62

Open
pushy opened this Issue · 4 comments

4 participants

@pushy

Hi all, I'm getting the following error in my application that uses Authlogic:

ActionView::TemplateError (undefined method `password' for #<User:0x2af83ebffa98>) on line #7     of app/views/users/_form.html.erb: 
4: <br /> 
5: 
6: <%= form.label :password, form.object.new_record? ? nil : "Change password" %><br /> 
7: <%= form.password_field :password %><br /> 
8: 
9: <br /> 
10:

It works perfectly locally, but when I run it on Heroku it stops working. I see that others have this issue, but no-one has been given an answer. All of the migrations are run, and I do have acts_as_authentic in my User model.

Thanks!

@pushy

Woops, I believe it's a problem with the order in which things are done while deploying. I pushed my code to Heroku, then I ran migrations. Pushing again restarted the application and probably got rid of the cached table names and fields.

@rsyring

Make sure your User class is using acts_as_authentic:

#app/models/user.rb
class User < ActiveRecord::Base
    acts_as_authentic
end

I did all kinds of troubleshooting and had somehow removed this when troubleshooting a different problem.

@freerobby

pushy, I've seen similar things. Always run a "heroku restart" after running your migrations and you should be fine.

@durrantm

I actually encountered this quite a bit recently with several apps and for me it was always that authLogic (or the right version for my rails 2.3.8) wasn't set in environment.rb, plus gem needs to be installed on the server at some point.
I knew it had to be config (not app code) 'cos the app. code was working locally and was the same as live.
The error is tough too because you search everywhere for that field but it's really in the gem. I use a regular ISP (Site5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.