nbudin / devise_openid_authenticatable

OpenID authentication for Devise
MIT License
99 stars 32 forks source link

Error in rails 5.1 #32

Open piotrbryniarski opened 7 years ago

piotrbryniarski commented 7 years ago

I am working on Rails 5.1 application. Getting error when trying to add devise_openid_authenticatable to my Gemfile:

backend_1        | [1] ! Unable to load application: NoMethodError: undefined method `alias_method_chain' for ActionController::Base:Class
backend_1        | Did you mean?  alias_method
backend_1        | bundler: failed to load command: puma (/usr/local/bundle/bin/puma)
backend_1        | NoMethodError: undefined method `alias_method_chain' for ActionController::Base:Class
backend_1        | Did you mean?  alias_method
backend_1        |   /usr/local/bundle/gems/devise_openid_authenticatable-1.3.0/lib/devise_openid_authenticatable/controller.rb:6:in `block in <module:Controller>'
backend_1        |   /usr/local/bundle/gems/activesupport-5.1.2/lib/active_support/concern.rb:120:in `class_eval'
backend_1        |   /usr/local/bundle/gems/activesupport-5.1.2/lib/active_support/concern.rb:120:in `append_features'
backend_1        |   /usr/local/bundle/gems/devise_openid_authenticatable-1.3.0/lib/devise_openid_authenticatable/railtie.rb:11:in `include'
backend_1        |   /usr/local/bundle/gems/devise_openid_authenticatable-1.3.0/lib/devise_openid_authenticatable/railtie.rb:11:in `block in <class:Railtie>'
backend_1        |   /usr/local/bundle/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `instance_exec'
backend_1        |   /usr/local/bundle/gems/railties-5.1.2/lib/rails/initializable.rb:30:in `run'
backend_1        |   /usr/local/bundle/gems/railties-5.1.2/lib/rails/initializable.rb:59:in `block in run_initializers'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `each'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `call'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
backend_1        |   /usr/local/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
backend_1        |   /usr/local/bundle/gems/railties-5.1.2/lib/rails/initializable.rb:58:in `run_initializers'
backend_1        |   /usr/local/bundle/gems/railties-5.1.2/lib/rails/application.rb:353:in `initialize!'
backend_1        |   /arbitrue/backend/config/environment.rb:5:in `<top (required)>'
backend_1        |   config.ru:3:in `require_relative'
backend_1        |   config.ru:3:in `block in <main>'
backend_1        |   /usr/local/bundle/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
backend_1        |   /usr/local/bundle/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
backend_1        |   config.ru:in `new'
backend_1        |   config.ru:in `<main>'
backend_1        |   /usr/local/bundle/gems/rack-2.0.3/lib/rack/builder.rb:49:in `eval'
backend_1        |   /usr/local/bundle/gems/rack-2.0.3/lib/rack/builder.rb:49:in `new_from_string'
backend_1        |   /usr/local/bundle/gems/rack-2.0.3/lib/rack/builder.rb:40:in `parse_file'
backend_1        |   /usr/local/bundle/gems/puma-3.9.1/lib/puma/configuration.rb:313:in `load_rackup'
backend_1        |   /usr/local/bundle/gems/puma-3.9.1/lib/puma/configuration.rb:242:in `app'
backend_1        |   /usr/local/bundle/gems/puma-3.9.1/lib/puma/runner.rb:138:in `load_and_bind'
backend_1        |   /usr/local/bundle/gems/puma-3.9.1/lib/puma/cluster.rb:391:in `run'
backend_1        |   /usr/local/bundle/gems/puma-3.9.1/lib/puma/launcher.rb:174:in `run'
backend_1        |   /usr/local/bundle/gems/puma-3.9.1/lib/puma/cli.rb:77:in `run'
backend_1        |   /usr/local/bundle/gems/puma-3.9.1/bin/puma:10:in `<top (required)>'
backend_1        |   /usr/local/bundle/bin/puma:17:in `load'
backend_1        |   /usr/local/bundle/bin/puma:17:in `<top (required)>'
nbudin commented 7 years ago

Ah, yup, alias_method_chain was deprecated in 5.0 and is gone in 5.1. The recommendation now is to use prepend and super: https://www.justinweiss.com/articles/rails-5-module-number-prepend-and-the-end-of-alias-method-chain/

I'm not using this gem myself anymore and am not sure I'll have time to fix this in the near future. If you'd be willing to make a PR, I'd review and merge it. Or, if someone is interested in taking over maintainership of this gem, I'd be happy to hand over the reins.

gerryhd commented 5 years ago

https://github.com/dantetekanem/devise_openid_authenticatable

Someone here did it. Is there anything missing in it before being good to merge?