-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrading from earlier versions
If you're currently using the plugin version (if you have a vendor/plugins/hoptoad_notifier directory, you are), you'll need to perform a few extra steps when upgrading to the gem version.
Add the airbrake gem to your app. In config/environment.rb:
config.gem 'airbrake'
Remove the plugin:
$ rm -rf vendor/plugins/hoptoad_notifier
Make sure the following line DOES NOT appear in your ApplicationController file:
include HoptoadNotifier::Catcher
If it does, remove it. The new catcher is automatically included by the gem version of Airbrake.
Before running the airbrake generator, you need to find your project's API key. Log in to your account at airbrake.io, and click on the "Projects" button. Then, find your project in the list, and click on its name. In the left-hand column, you'll see an "Edit this project" button. Click on that to get your project's API key. If you accidentally use your personal API auth_token, you will get API key not found errors, and exceptions will not be stored by the Airbrake service.
Then from your project's RAILS_ROOT, run:
$ rake gems:install
$ script/generate airbrake --api-key your_key_here
Once installed, you should vendor the airbrake gem.
$ rake gems:unpack GEM=airbrake
As always, if you choose not to vendor the airbrake gem, make sure every server you deploy to has the gem installed or your application won't start.
If you're currently using the gem version of the hoptoad_notifier and have a version of Rails that uses config.gem (in the 2.x series), there is a step or two that you need to do to upgrade. First, you need to remove the old version of the gem from vendor/gems:
$ rm -rf vendor/gems/hoptoad_notifier-X.X.X
Then you must remove the hoptoad_notifier_tasks.rake file from lib:
$ rm lib/tasks/hoptoad_notifier_tasks.rake
You can then continue to install normally. If you don't remove the rake file, you will be unable to unpack this gem (Rails will think it's part of the framework).
You can test that Airbrake is working in your production environment by using this rake task (from RAILS_ROOT):
$ rake airbrake:test
If everything is configured properly, that task will send a notice to Airbrake which will be visible immediately.
in your ApplicationController, REMOVE this line:
include HoptoadNotifiable
In your config/environment* files, remove all references to HoptoadNotifier
Remove the vendor/plugins/hoptoad_notifier directory.
Remove the vendor/plugins/hoptoad_notifier directory before installing the gem, or run:
$ script/plugin remove hoptoad_notifier