Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails airbrake undefined method

I was running my rails application and it was working fine till yesterday but today when i run rails server it is giving me this error.Though my airbrake is also dont have any errors
[airbrake.rb]

Airbrake.configure do |config|
  config.api_key = APP_CONFIG.airbrake.api_key
  config.host    = APP_CONFIG.airbrake.host
  config.port    = APP_CONFIG.airbrake.port
  config.secure  = config.port == 443
end


undefined method `api_key=' for #<Airbrake::Config:0x000000073fa1e0> (NoMethodError)
  from /home/techbirds/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:98:in

configure' from /home/techbirds/icare-master/config/initializers/airbrake.rb:1:in ' from /home/techbirds/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:in load' from /home/techbirds/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:268:inblock in load' from /home/techbirds/.rvm/gems/ruby-2.2.3/gems/activesupport-

like image 735
aniket tiwari Avatar asked Dec 24 '15 09:12

aniket tiwari


2 Answers

It looks like you have inadvertently upgraded to the new v5 Airbrake gem. You can either:

  1. follow the migration guide to migrate from airbrake v4 to v5, or
  2. lock airbrake to v4, in the gemfile, e.g. something like gem 'airbrake', '~> 4.3.4'
like image 83
zefer Avatar answered Nov 07 '22 01:11

zefer


Have you check the Migration guide on the github repo?

Old option | New option  | required?
api_key    | project_key | required
.......    | ........... | ........
like image 2
Philidor Avatar answered Nov 07 '22 03:11

Philidor