chrodriguez / redmine_omniauth_saml

Plugins that adds SAML authentication support for "Redmine"
GNU General Public License v2.0
38 stars 57 forks source link

undefined method `alias_method_chain' for User #42

Open alex-3sr opened 5 years ago

alex-3sr commented 5 years ago

Hi,

I'm trying to install the plugin on a Redmine 4.0 but when after cloning GIT project, I run RAILS_ENV=production rake redmine:plugins and I got this error

(in /opt/bitnami/apps/redmine/htdocs) rake aborted! NoMethodError: undefined method alias_method_chain' for User (call 'User.connection' to establish a connection):Class Did you mean? alias_method /opt/bitnami/apps/redmine/htdocs/plugins/redmine_omniauth_saml/lib/redmine_omniauth_saml/user_patch.rb:29:in' /opt/bitnami/apps/redmine/htdocs/plugins/redmine_omniauth_saml/lib/redmine_omniauth_saml/user_patch.rb:3:in <top (required)>' /opt/bitnami/apps/redmine/htdocs/plugins/redmine_omniauth_saml/init.rb:4:in<top (required)>' /opt/bitnami/apps/redmine/htdocs/lib/redmine/plugin.rb:173:in block in load' /opt/bitnami/apps/redmine/htdocs/lib/redmine/plugin.rb:164:ineach' /opt/bitnami/apps/redmine/htdocs/lib/redmine/plugin.rb:164:in load' /opt/bitnami/apps/redmine/htdocs/config/initializers/30-redmine.rb:21:in<top (required)>' /opt/bitnami/apps/redmine/htdocs/config/environment.rb:14:in <top (required)>' /opt/bitnami/apps/redmine/htdocs/lib/tasks/redmine.rake:57:inblock (2 levels) in <top (required)>' Tasks: TOP => redmine:plugins:migrate => environment (See full trace by running task with --trace)

Ruby version -> ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-linux]

Thank you for your help, Alexandre

pierro78 commented 5 years ago

same issue here, redmine 4.0.1 on debian 9, ruby 2.3 , did you find a solution ??? Thanks !

PS : had no problem with redmine 3.3 from the debian packages ...

alex-3sr commented 5 years ago

same issue here on debian 9, ruby 2.3 , did you find a solution ??? Thanks ! PS : had no problem with redmine 3.3 from the debian packages ...

Hi, nope still have no solution :( I tried an another plugin who work lees or more : https://github.com/Gucin/redmine_omniauth_azure

rroblik commented 5 years ago

+1 I'm not Ruby export but maybe there is a quickfix ?

ibotex commented 5 years ago

With Rails 5.0 the use of alias_method_chain is deprecated. Someone has to rewrite the plugin and use "prepend" to include the code instead. Further info: https://www.justinweiss.com/articles/rails-5-module-number-prepend-and-the-end-of-alias-method-chain/