ruby-on-railsexceptiondeploymenterror-handlingerrbit

undefined method `method=' in airbrake with errbit


When I do rake airbrake:test I get this exception on production. Errbit app hosts on heroku and does not recieving any messages from production. What the problem is?

Airbrake v 3.1.8

Errbit v - last from github

undefined method `method=' for #<BacktraceLine:0x00000005a0d160>

app/models/backtrace.rb:27:in `new'
app/models/backtrace.rb:27:in `block in raw='
app/models/backtrace.rb:26:in `each'
app/models/backtrace.rb:26:in `raw='
app/models/backtrace.rb:18:in `new'
app/models/backtrace.rb:18:in `find_or_create'
app/models/error_report.rb:33:in `backtrace'
app/models/error_report.rb:40:in `generate_notice!'
lib/overrides/hoptoad_notifier/hoptoad_notifier.rb:18:in `send_notice'

Solution

  • This is a known issue in Errbit caused by a change in Airbrake after 3.1.8.

    A fix was committed to an unnamed branch of Errbit 7 days ago (as of this writing).

    Reinstall Errbit from the unnamed branch, or implement the changes manually. Or wait until the fix makes its way to the Errbit trunk, then upgrade per instructions in the Errbit readme.

    Alternately, you can downgrade to an older version of Airbrake. Version 3.1.8 does not contain the breaking changes. I verified this by installing Airbrake 3.1.8 on my machine and inspecting the files. Put this in your Gemfile, then run bundle install:

    gem "airbrake", "3.1.8"
    

    Edit:

    Since you are verifiably using a compatible version of Airbrake, look at Errbit.

    In the current Errbit trunk, BacktraceLine#method= (source) is an interface provided by Mongoid. An undefined method error means Mongoid is not providing the method at runtime. You may have an initialization or configuration issue with Mongoid in your test environment.

    Edit 2:

    Turns out this error is caused by Errbit being installed without Mongoid, which Errbit requires.

    Errbit overrides the Airbrake notifier gem with hooks back to Errbit, thus using Airbrake will inadvertently invoke Errbit. Without Mongoid, Errbit will fail.

    Two solutions are available:

    or...