Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise upgrade from 1.1.5 to 1.4.5 causes Wrong Number of Arguments error

I just upgraded from Devise 1.1.5 to 1.4.5 to use with Rails 3.1 (1.1.5 seems to cause a bcrypt gem version problem).

Now user_signed_in? throws " wrong number of arguments (1 for 2)"

Stack trace is:
devise (1.4.5) lib/devise/models/authenticatable.rb:89:in `serialize_from_session'
devise (1.4.5) lib/devise/rails/warden_compat.rb:27:in `deserialize'
warden (1.0.5) lib/warden/session_serializer.rb:31:in `fetch'
warden (1.0.5) lib/warden/proxy.rb:182:in `user'
warden (1.0.5) lib/warden/proxy.rb:278:in `_perform_authentication'
warden (1.0.5) lib/warden/proxy.rb:90:in `authenticate'
devise (1.4.5) lib/devise/controllers/helpers.rb:48:in `current_user'
devise (1.4.5) lib/devise/controllers/helpers.rb:44:in `user_signed_in?'
app/controllers/main_controller.rb:24:in `index'
actionpack (3.1.0) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.1.0) lib/abstract_controller/base.rb:167:in `process_action'
.....

Anyone experiencing this?

like image 978
mmadrid99 Avatar asked Sep 13 '11 15:09

mmadrid99


2 Answers

I ran rake tmp:clear and changed the name of my session in session_store.rb

Woodhack::Application.config.session_store :cookie_store, :key => '_NEW_NAME_HERE_session'

like image 130
jspooner Avatar answered Oct 06 '22 00:10

jspooner


You can also change one character in your config/initializers/secret_token.rb

like image 41
stebooks Avatar answered Oct 05 '22 23:10

stebooks