ActionView::Template::Error (Model User does not respond to password):
After upgrading rails from 3.0.0 to 3.0.1 and passenger to 3.0 I am getting this error in production:
ActionView::Template::Error (Model User does 开发者_JS百科not respond to password):
23:
24: <p>
25: <%= f.label :password %><br />
26: <%= f.password_field :password %>
27: </p>
28: <p>
29: <%= f.label :password_confirmation %><br />
app/views/users/new.html.erb:26:in `_app_views_users_new_html_erb___104064734$
In development this page works fine but with some deprecation warnings:
Started GET "/users/new" for 127.0.0.1 at Sat Nov 06 22:08:49 -0700 2010
Processing by UsersController#new as HTML
DEPRECATION WARNING: Base.named_scope has been deprecated, please use Base.scope instead. (called from included at /home/sean/chief/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/logged_in_status.rb:35)
DEPRECATION WARNING: Base.named_scope has been deprecated, please use Base.scope instead. (called from included at /home/sean/chief/vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/logged_in_status.rb:36)
Rendered users/new.html.erb within layouts/application (25.3ms)
Completed 200 OK in 70ms (Views: 32.5ms | ActiveRecord: 1.0ms)
I ran into a similar error when testing my application on heroku. For me, the fix was as simple as updating my rails gem to the latest 3.0.3 (I am also using authlogic from a git source). I.e. my Gemfile contains the following:
gem 'rails', '3.0.3'
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
I then ran:
bundle update
To rebuild my snapshot from scratch, and this resolved the (Model does not respond to password) error that I was getting.
Hope this fixes your similar problem as well.
精彩评论