choiceaustralia / discourse-donations

A discourse plugin for accepting donations via Stripe
MIT License
9 stars 8 forks source link

undefined method `skip_before_filter' for DiscourseDonations::ChargesController:Class #10

Open chrisbeach opened 7 years ago

chrisbeach commented 7 years ago

I get the following error in my unicorn log when trying to use discourse-donations:

/var/www/discourse/plugins/discourse-donations/app/controllers/discourse_donations/charges_controller.rb:7:in `<class:ChargesController>': undefined method `skip_before_filter' for DiscourseDonations::ChargesController:Class (NoMethodError)
Did you mean?  skip_before_action
        from /var/www/discourse/plugins/discourse-donations/app/controllers/discourse_donations/charges_controller.rb:4:in `<module:DiscourseDonations>'
        from /var/www/discourse/plugins/discourse-donations/app/controllers/discourse_donations/charges_controller.rb:3:in `<top (required)>'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:379:in `block in require_or_load'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:in `block in load_interlock'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:12:in `block in loading'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:11:in `loading'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:36:in `load_interlock'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:357:in `require_or_load'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:335:in `depend_on'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:251:in `require_dependency'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:476:in `block (2 levels) in eager_load!'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `each'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:475:in `block in eager_load!'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `each'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:473:in `eager_load!'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:354:in `eager_load!'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `each'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `each'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `call'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `public_send'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `method_missing'
        from /var/www/discourse/config/environment.rb:5:in `<top (required)>'
        from config.ru:3:in `require'
        from config.ru:3:in `block in <main>'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `instance_eval'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:55:in `initialize'
        from config.ru:1:in `new'
        from config.ru:1:in `<main>'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn.rb:56:in `eval'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn.rb:56:in `block in builder'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:796:in `build_app!'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/lib/unicorn/http_server.rb:139:in `start'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.3.0/bin/unicorn:126:in `<top (required)>'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in `load'
        from /var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in `<main>'
chrisbeach commented 7 years ago

I have forked the repo, taught myself some rudimentary Ruby / Rails and sussed out that this error originated in the Discourse core upgrade to Rails 5.

I've fixed this on my fork: https://github.com/chrisbeach/discourse-donations/commit/340959c73b797e56e4d08d49cfa9eb456f48701a