{"action":"created","issue":{"url":"https://api.github.com/repos/airbrake/airbrake-ruby/issues/13","labels_url":"https://api.github.com/repos/airbrake/airbrake-ruby/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/airbrake/airbrake-ruby/issues/13/comments","events_url":"https://api.github.com/repos/airbrake/airbrake-ruby/issues/13/events","html_url":"https://github.com/airbrake/airbrake-ruby/issues/13","id":123748149,"number":13,"title":"Unnecessary airbrake error when running unknown rake task","user":{"login":"khustochka","id":137464,"avatar_url":"https://avatars.githubusercontent.com/u/137464?v=3","gravatar_id":"","url":"https://api.github.com/users/khustochka","html_url":"https://github.com/khustochka","followers_url":"https://api.github.com/users/khustochka/followers","following_url":"https://api.github.com/users/khustochka/following{/other_user}","gists_url":"https://api.github.com/users/khustochka/gists{/gist_id}","starred_url":"https://api.github.com/users/khustochka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khustochka/subscriptions","organizations_url":"https://api.github.com/users/khustochka/orgs","repos_url":"https://api.github.com/users/khustochka/repos","events_url":"https://api.github.com/users/khustochka/events{/privacy}","received_events_url":"https://api.github.com/users/khustochka/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/airbrake/airbrake-ruby/labels/Bug","name":"Bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-12-24T02:24:41Z","updated_at":"2016-01-14T23:19:10Z","closed_at":"2016-01-02T20:31:29Z","body":"* Airbrake version: 5.0.1\r\n* Ruby version: 2.2.3\r\n* Framework name & version: Rails 4.2.5\r\n\r\n#### Airbrake config\r\n\r\n````\r\n  Airbrake.configure do |config|\r\n    config.project_id = <project_id>\r\n    config.project_key = <project_key>\r\n    config.host = <host>\r\n    config.ignore_environments = [:test]\r\n  end\r\n````\r\n\r\n#### Description\r\n\r\nI checked that my config is OK by running `rake airbrake:test`, it runs successfully.\r\n\r\nBut when I run a rake task that does not exist I am getting the following output:\r\n\r\n````\r\n$ bin/rake kokoko:dskfkl\r\nrake aborted!\r\nDon't know how to build task 'kokoko:dskfkl'\r\n\r\n(See full trace by running task with --trace)\r\n/Users/vkhustochka/.rvm/gems/ruby-2.2.3@quails/gems/airbrake-ruby-1.0.1/lib/airbrake-ruby.rb:282:in `call_notifier': the 'default' notifier isn't configured (Airbrake::Error)\r\n\tfrom /Users/vkhustochka/.rvm/gems/ruby-2.2.3@quails/gems/airbrake-ruby-1.0.1/lib/airbrake-ruby.rb:149:in `notify_sync'\r\n\tfrom /Users/vkhustochka/.rvm/gems/ruby-2.2.3@quails/gems/airbrake-ruby-1.0.1/lib/airbrake-ruby.rb:291:in `block in <top (required)>'\r\n````\r\n\r\nI think the issue is that in this case airbrake is loaded (through bundler) but initializers are not loaded, so Airbrake config is not loaded."},"comment":{"url":"https://api.github.com/repos/airbrake/airbrake-ruby/issues/comments/171814031","html_url":"https://github.com/airbrake/airbrake-ruby/issues/13#issuecomment-171814031","issue_url":"https://api.github.com/repos/airbrake/airbrake-ruby/issues/13","id":171814031,"user":{"login":"rafaelgonzalez","id":456921,"avatar_url":"https://avatars.githubusercontent.com/u/456921?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelgonzalez","html_url":"https://github.com/rafaelgonzalez","followers_url":"https://api.github.com/users/rafaelgonzalez/followers","following_url":"https://api.github.com/users/rafaelgonzalez/following{/other_user}","gists_url":"https://api.github.com/users/rafaelgonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelgonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelgonzalez/subscriptions","organizations_url":"https://api.github.com/users/rafaelgonzalez/orgs","repos_url":"https://api.github.com/users/rafaelgonzalez/repos","events_url":"https://api.github.com/users/rafaelgonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelgonzalez/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T23:19:10Z","updated_at":"2016-01-14T23:19:10Z","body":"@kyrylo \r\n\r\n> @rafaelgonzalez what happens when you configure your Airbrake inside spec_helper.rb (simply copy-paste the config)?\r\n\r\nIf I add the airbrake config to my `spec_helper.rb` like so:\r\n\r\n```ruby\r\nrequire 'simplecov'\r\nSimpleCov.start 'rails'\r\n\r\nrequire 'factory_girl_rails'\r\nrequire 'airbrake'\r\n\r\nRSpec.configure do |config|\r\n  config.expect_with :rspec do |expectations|\r\n    expectations.include_chain_clauses_in_custom_matcher_descriptions = true\r\n  end\r\n\r\n  config.mock_with :rspec do |mocks|\r\n    mocks.verify_partial_doubles = true\r\n  end\r\n\r\n  config.filter_run :focus\r\n  config.run_all_when_everything_filtered = true\r\n\r\n  config.disable_monkey_patching!\r\n\r\n  if config.files_to_run.one?\r\n    config.default_formatter = 'doc'\r\n  end\r\n\r\n  config.order = :random\r\n\r\n  Kernel.srand config.seed\r\n\r\n  config.include FactoryGirl::Syntax::Methods\r\nend\r\n\r\nAirbrake.configure do |config|\r\n  config.project_id = 'foo'\r\n  config.project_key = 'bar'\r\n\r\n  config.environment = Rails.env # I added this the config since my previous post, but removing it does not affect this issue\r\n  config.ignore_environments = %w(development test)\r\nend\r\n```\r\n\r\nSorry for the verbosity, just want to give you as much context as possible.\r\n\r\n> Do you get the same results with:\r\n>\r\n> - `rake spec` (without the env specifier)\r\n> - `bundle exec rake`\r\n\r\n- `rake spec` does not output anything for me when not specifying the environment (I suspect this is because RSpec is under the `:test:` group in my Gemfile)\r\n\r\n- `bundle exec rspec` does **not** trigger the error when specs fail.\r\n\r\n- `bundle exec rake` does trigger the error when specs fail (this is how I came across this issue in the first place)"}}