jbbarth / redmine_omniauth_cas

CAS authentication plugin for Redmine through OmniAuth
MIT License
19 stars 14 forks source link

undefined method `cas_host' for class `OmniAuth::Strategies::CAS' #9

Closed madhippie closed 8 years ago

madhippie commented 11 years ago

Hi there,

first of all: thanks for this great plugin!

Unfortunately, after migrating my Redmine 2.2 Installation to a Server running Ruby 1.9.3 and Rails 3.2.13, I get the following error:

undefined method cas_host' for classOmniAuth::Strategies::CAS' /home/rails/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/core_ext/module/aliasing.rb:31:in alias_method' /home/rails/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/core_ext/module/aliasing.rb:31:inalias_method_chain'

Is this an issue with with my activesupport gem?

mmackiew commented 10 years ago

Sane problem here. I've got Ubuntu 12.04.3 and Redmine installed from packages: redmine redmine-pgsql.

Since yesterday i use Redmine 2.3.1.stable. Before that used Redmine 2.2.3.stable. After update of course system crashed (ruby 1.8 -> 1.9.3). When i clean this mess up i tried to install fresh plugin. I've got same error but on plugin installation.

System versions: Ubuntu 12.04.3 LTS Redmine 2.3.1.stable

Environment: Redmine version 2.3.1.stable Ruby version 1.9.3 (x86_64-linux) Rails version 3.2.13 Environment production Database adapter PostgreSQL Redmine plugins: redmine_ckeditor 0.2.1 redmine_embedded_video 0.0.3.1 redmine_graphs 0.1.0 redmine_issue_templates 0.0.5 redmine_mylyn_connector 2.8.2.stable redmine_theme_changer 0.1.0 redmine_wiki_extensions 0.6.3 sidebar_hide 0.0.3

Log after command rake redmine:plugins:migrate RAILS_ENV=production --trace is:

* Invoke redmine:plugins:migrate (first_time) * Invoke environment (first_time) \ Execute environment rake aborted! undefined method cas_host' for classOmniAuth::Strategies::CAS' /usr/lib/ruby/vendor_ruby/active_support/core_ext/module/aliasing.rb:31:in alias_method' /usr/lib/ruby/vendor_ruby/active_support/core_ext/module/aliasing.rb:31:inalias_method_chain' /usr/share/redmine/plugins/redmine_omniauth_cas/lib/omniauth/patches.rb:12:in <class:CAS>' /usr/share/redmine/plugins/redmine_omniauth_cas/lib/omniauth/patches.rb:5:inmodule:Strategies' /usr/share/redmine/plugins/redmine_omniauth_cas/lib/omniauth/patches.rb:4:in <module:OmniAuth>' /usr/share/redmine/plugins/redmine_omniauth_cas/lib/omniauth/patches.rb:3:in<top (required)>' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in require' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:inblock in require' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:236:in load_dependency' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:inrequire' /usr/share/redmine/plugins/redmine_omniauth_cas/init.rb:4:in <top (required)>' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:inrequire' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in block in require' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:236:inload_dependency' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:251:in require' /usr/share/redmine/lib/redmine/plugin.rb:130:inblock in load' /usr/share/redmine/lib/redmine/plugin.rb:121:in each' /usr/share/redmine/lib/redmine/plugin.rb:121:inload' /usr/share/redmine/config/initializers/30-redmine.rb:12:in <top (required)>' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:245:inload' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:245:in block in load' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:236:inload_dependency' /usr/lib/ruby/vendor_ruby/active_support/dependencies.rb:245:in load' /usr/lib/ruby/vendor_ruby/rails/engine.rb:588:inblock (2 levels) in class:Engine' /usr/lib/ruby/vendor_ruby/rails/engine.rb:587:in each' /usr/lib/ruby/vendor_ruby/rails/engine.rb:587:inblock in class:Engine' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:in instance_exec' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:30:inrun' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:55:in block in run_initializers' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:ineach' /usr/lib/ruby/vendor_ruby/rails/initializable.rb:54:in run_initializers' /usr/lib/ruby/vendor_ruby/rails/application.rb:136:ininitialize!' /usr/lib/ruby/vendor_ruby/rails/railtie/configurable.rb:30:in method_missing' /usr/share/redmine/config/environment.rb:14:in<top (required)>' /usr/lib/ruby/vendor_ruby/rails/application.rb:103:in require' /usr/lib/ruby/vendor_ruby/rails/application.rb:103:inrequire_environment!' /usr/lib/ruby/vendor_ruby/rails/application.rb:297:in block (2 levels) in initialize_tasks' /usr/lib/ruby/vendor_ruby/rake/task.rb:205:incall' /usr/lib/ruby/vendor_ruby/rake/task.rb:205:in block in execute' /usr/lib/ruby/vendor_ruby/rake/task.rb:200:ineach' /usr/lib/ruby/vendor_ruby/rake/task.rb:200:in execute' /usr/lib/ruby/vendor_ruby/rake/task.rb:158:inblock in invoke_with_call_chain' /usr/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /usr/lib/ruby/vendor_ruby/rake/task.rb:151:ininvoke_with_call_chain' /usr/lib/ruby/vendor_ruby/rake/task.rb:176:in block in invoke_prerequisites' /usr/lib/ruby/vendor_ruby/rake/task.rb:174:ineach' /usr/lib/ruby/vendor_ruby/rake/task.rb:174:in invoke_prerequisites' /usr/lib/ruby/vendor_ruby/rake/task.rb:157:inblock in invoke_with_call_chain' /usr/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /usr/lib/ruby/vendor_ruby/rake/task.rb:151:ininvoke_with_call_chain' /usr/lib/ruby/vendor_ruby/rake/task.rb:144:in invoke' /usr/lib/ruby/vendor_ruby/rake/application.rb:116:ininvoke_task' /usr/lib/ruby/vendor_ruby/rake/application.rb:94:in block (2 levels) in top_level' /usr/lib/ruby/vendor_ruby/rake/application.rb:94:ineach' /usr/lib/ruby/vendor_ruby/rake/application.rb:94:in block in top_level' /usr/lib/ruby/vendor_ruby/rake/application.rb:133:instandard_exception_handling' /usr/lib/ruby/vendor_ruby/rake/application.rb:88:in top_level' /usr/lib/ruby/vendor_ruby/rake/application.rb:66:inblock in run' /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in standard_exception_handling' /usr/lib/ruby/vendor_ruby/rake/application.rb:63:inrun' /usr/bin/rake:27:in `

' Tasks: TOP => redmine:plugins:migrate => environment

jbbarth commented 10 years ago

I'll try to reproduce as soon as I can, I suspect I don't have the problem because I still run redmine-2.1.6 in production :/ Could you tell me your gems versions, especially omniauth and omniauth-cas ? Thanks

jbbarth commented 10 years ago

OK I reproduced the problem, no need to check your omniauth-cas version.

It seems omniauth-cas introduced a breaking change between 1.0.1 (the one I'm happily using in production right now) and 1.0.4. I don't really have the time to dig in that now, it has changed other things so I have to test it properly..

Quick fix for you : in the Gemfile in the plugin, change the ">= 1.0.1" on the "omniauth-cas" line with a "= 1.0.1". Then run bundle install again from the root of your redmine installation.

To test the change before rebooting, you can just run rails runner "" which won't raise an exception if the fix was sucessful.

mmackiew commented 10 years ago

W dniu 13-10-08 00:12, Jean-Baptiste Barth pisze:

I'll try to reproduce as soon as I can, I suspect I don't have the problem because I still run redmine-2.1.6 in production :/ Could you tell me your gems versions, especially omniauth and omniauth-cas ? Thanks

— Reply to this email directly or view it on GitHub https://github.com/jbbarth/redmine_omniauth_cas/issues/9#issuecomment-25849905.

Hi,

Thank you for quick respond.

Done what u said. Error form bu #8 come back to me but i managed it.

Everything is working fine now. Thank you so much.

/Marcin Mackiewicz/ Administrator Baz Danych / Programista Dział Informatyki Wyższa Szkoła Bankowa w Poznaniu Wydział Finansów i Bankowości

jbbarth commented 10 years ago

No problem. I'll have a proper fix soon in the master branch, I'll post updates in this ticket

madhippie commented 10 years ago

Merci beaucoup, Jean!

shadowbq commented 8 years ago

Stale.. saw this issue .. was there a resolution?

jbbarth commented 8 years ago

See above, there was a breaking change above omniauth-cas 1.0.1 so I locked the version in the Gemfile. This can be closed I think...