Skip to content

Adding custom github webhook getting "NameError: uninitialized constant Handlers" #1084

Open
@stairsj

Description

Hello,

Newbie Ruby developer, I am trying to add a custom github webhook listener to shipit. I have modified by environments/development.rb and added the following lines

Shipit::Webhooks.register_handler('issue_comment') do |params| puts "Webhook Calling issue_comment" end

I end up with the following error message on start

rake aborted! NameError: uninitialized constant Handlers /usr/local/bundle/gems/shipit-engine-0.31.0/app/models/shipit/webhooks.rb:6:indefault_handlers'
/usr/local/bundle/gems/shipit-engine-0.31.0/app/models/shipit/webhooks.rb:18:in reset_handlers!' /usr/local/bundle/gems/shipit-engine-0.31.0/app/models/shipit/webhooks.rb:14:in handlers'
/usr/local/bundle/gems/shipit-engine-0.31.0/app/models/shipit/webhooks.rb:22:in register_handler' /var/shipit/config/environments/development.rb:65:in block in <top (required)>'
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/railtie.rb:216:in instance_eval' /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/railtie.rb:216:in configure'
/var/shipit/config/environments/development.rb:1:in <top (required)>' /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:612:in block (2 levels) in class:Engine'
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:611:in each' /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:611:in block in class:Engine'
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in instance_exec' /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:32:in run'
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:61:in block in run_initializers' /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:50:in each'
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:50:in tsort_each_child' /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/initializable.rb:60:in run_initializers'
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/application.rb:363:in initialize!' /var/shipit/config/environment.rb:5:in <top (required)>'
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/application.rb:339:in require_environment!' /usr/local/bundle/gems/railties-6.0.2.1/lib/rails/application.rb:515:in block in run_tasks_blocks'
Tasks: TOP => railties:install:migrations => db:load_config => environment
(See full trace by running task with --trace)
`
Any assistance would be greatly appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions