nbudin / devise_cas_authenticatable

CAS authentication support for Devise
MIT License
285 stars 117 forks source link

undefined method `prepare!' for class `ActionDispatch::Session::AbstractStore' #17

Open restebanez opened 13 years ago

restebanez commented 13 years ago

Hi there,

devise_cas_authenticatable seems not to work in rails 3.1.1 and ruby 1.9.2-p290. After bundle install, i run:

rails generate devise User, and i got this error:

/Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/activesupport-3.1.1/lib/active_support/core_ext/module/aliasing.rb:31:in alias_method': undefined methodprepare!' for class ActionDispatch::Session::AbstractStore' (NameError) from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/activesupport-3.1.1/lib/active_support/core_ext/module/aliasing.rb:31:inalias_method_chain' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/devise_cas_authenticatable-1.0.0.alpha12/lib/devise_cas_authenticatable/single_sign_out.rb:24:in block in <top (required)>' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/devise_cas_authenticatable-1.0.0.alpha12/lib/devise_cas_authenticatable/single_sign_out.rb:19:inclass_eval' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/devise_cas_authenticatable-1.0.0.alpha12/lib/devise_cas_authenticatable/single_sign_out.rb:19:in <top (required)>' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:inrequire' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in block in require' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:inblock in load_dependency' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in new_constants_in' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:inload_dependency' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/devise_cas_authenticatable-1.0.0.alpha12/lib/devise_cas_authenticatable.rb:8:in<top (required)>' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in require' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:inblock (2 levels) in require' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in each' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:inblock in require' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in each' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:inrequire' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/bundler-1.0.21/lib/bundler.rb:122:in require' from /Users/restebanez/agi/config/application.rb:13:in<top (required)>' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/railties-3.1.1/lib/rails/commands.rb:21:in require' from /Users/restebanez/.rvm/gems/ruby-1.9.2-p290@agi/gems/railties-3.1.1/lib/rails/commands.rb:21:in<top (required)>' from script/rails:6:in require' from script/rails:6:in

'

Here is my bundle list:

Gems included by the bundle:

  • actionmailer (3.1.1)
  • actionpack (3.1.1)
  • activemodel (3.1.1)
  • activerecord (3.1.1)
  • activeresource (3.1.1)
  • activesupport (3.1.1)
  • arel (2.2.1)
  • bcrypt-ruby (3.0.1)
  • builder (3.0.0)
  • bundler (1.0.21)
  • coffee-rails (3.1.1)
  • coffee-script (2.2.0)
  • coffee-script-source (1.1.2)
  • devise (1.4.8)
  • devise_cas_authenticatable (1.0.0.alpha12)
  • erubis (2.7.0)
  • execjs (1.2.9)
  • hike (1.2.1)
  • i18n (0.6.0)
  • jquery-rails (1.0.14)
  • json (1.6.1)
  • mail (2.3.0)
  • mime-types (1.16)
  • multi_json (1.0.3)
  • orm_adapter (0.0.5)
  • polyglot (0.3.2)
  • rack (1.3.3)
  • rack-cache (1.1)
  • rack-mount (0.8.3)
  • rack-ssl (1.3.2)
  • rack-test (0.6.1)
  • rails (3.1.1)
  • railties (3.1.1)
  • rake (0.9.2)
  • rdoc (3.10)
  • rubycas-client (2.2.1)
  • sass (3.1.10)
  • sass-rails (3.1.4)
  • sprockets (2.0.2)
  • sqlite3 (1.3.4)
  • thor (0.14.6)
  • tilt (1.3.3)
  • treetop (1.4.10)
  • tzinfo (0.3.30)
  • uglifier (1.0.3)
  • warden (1.0.6)

Thanks,

Rodrigo

nbudin commented 13 years ago

Hi Rodrigo, thanks for the bug report! We're actually aware of the issue and there's a potential fix checked into master, but we're still testing to make sure we haven't broken single sign-out support.

If you like, please try changing to use the master branch from git in your Gemfile:

gem 'devise_cas_authenticatable', :git => 'git://github.com/nbudin/devise_cas_authenticatable.git'

If that doesn't work for you, please let me know!

ghost commented 13 years ago

how's the fix coming along?

restebanez commented 13 years ago

The bug went away using the git repository. Thanks a lot!

nbudin commented 13 years ago

At this point I'm satisfied that this fixes Rails 3.1. The only question is whether this change breaks single sign-out support, which jeremyhaile coded. I don't have a CAS server with single sign-out to test it with, so I'll either have to set one up or write a unit test to simulate one. If anyone has a SSO-enabled CAS server and would like to give it a try, that would probably speed the release.

restebanez commented 13 years ago

In a month or so i'll returned to the CAS authentication, after i saw that the bug went away, i had to change to a different project. I'll report to you as soon as CAS is configured and working

jazzdan commented 13 years ago

Hi all,

When I followed nbudin's instructions to fix this issue I encountered this error upon executing bundler:

Using devise_cas_authenticatable (1.0.0.alpha12) from git://github.com/nbudin/devise_cas_authenticatable.git (at master) 
NoMethodError: undefined method `write' for #<Syck::Emitter:0x007f9fef20a558>
An error occured while installing devise_cas_authenticatable (1.0.0.alpha12), and Bundler cannot continue.
Make sure that `gem install devise_cas_authenticatable -v '1.0.0.alpha12'` succeeds before bundling.

The gem install command succeeds however:

gem install devise_cas_authenticatable -v '1.0.0.alpha12'
Successfully installed devise_cas_authenticatable-1.0.0.alpha12
1 gem installed
Installing ri documentation for devise_cas_authenticatable-1.0.0.alpha12...
Installing RDoc documentation for devise_cas_authenticatable-1.0.0.alpha12...

Is this related to the above issue?

EDIT: Turns out I just needed to update the bundler gem, d'oh!

gem install bundler
dwaynemac commented 13 years ago

i switched to :git version and it was solved as well. but i don't have a SSO to help, sorry