Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 95 lines (60 sloc) 3.235 kb
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
1 Airbrake on Heroku
2 ==================
3
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
4 Send your application errors to our hosted service and reclaim your inbox.
5
6 1. Installing the Heroku add-on
7 ----------------------------
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
8 To use Airbrake on Heroku, install the Airbrake add-on:
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
9
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
10 $ heroku addons:add airbrake:basic # This adds the the basic plan.
11 # If you'd like another plan, specify that instead.
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
12
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
13 2. Including the Airbrake notifier in your application
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
14 --------------------------------------------------
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
15 After adding the Airbrake add-on, you will need to install and configure the Airbrake notifier.
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
16
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
17 Your application connects to Airbrake with an API key. On Heroku, this is automatically provided to your
18 application in `ENV['HOPTOAD_API_KEY']`, so installation should be a snap! (Hoptoad is Airbrake's old name.)
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
19
20 ### Rails 3.x
21
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
22 Add the airbrake and heroku gems to your Gemfile. In Gemfile:
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
23
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
24 gem 'airbrake'
9558536 @jasonm Add instructions for heroku gem to Heroku addon README
jasonm authored
25 gem 'heroku'
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
26
27 Then from your project's RAILS_ROOT, run:
28
29 $ bundle install
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
30 $ script/rails generate airbrake --heroku
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
31
32 ### Rails 2.x
33
9558536 @jasonm Add instructions for heroku gem to Heroku addon README
jasonm authored
34 Install the heroku gem if you haven't already:
35
36 gem install heroku
37
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
38 Add the airbrake gem to your app. In config/environment.rb:
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
39
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
40 config.gem 'airbrake'
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
41
42 Then from your project's RAILS_ROOT, run:
43
44 $ rake gems:install
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
45 $ rake gems:unpack GEM=airbrake
46 $ script/generate airbrake --heroku
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
47
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
48 As always, if you choose not to vendor the airbrake gem, make sure
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
49 every server you deploy to has the gem installed or your application won't start.
50
51 ### Rack applications
52
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
53 In order to use airbrake in a non-Rails rack app, just load the airbrake, configure your API key, and use the Airbrake::Rack middleware:
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
54
55 require 'rubygems'
56 require 'rack'
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
57 require 'airbrake'
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
58
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
59 Airbrake.configure do |config|
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
60 config.api_key = `ENV['HOPTOAD_API_KEY']`
61 end
62
63 app = Rack::Builder.app do
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
64 use Airbrake::Rack
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
65 run lambda { |env| raise "Rack down" }
66 end
67
68 ### Rails 1.x
69
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
70 For Rails 1.x, visit the [Airbrake notifier's README on GitHub](http://github.com/thoughtbot/airbrake),
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
71 and be sure to use `ENV['HOPTOAD_API_KEY']` where your API key is required in configuration code.
72
f71c71f @jasonm Add Heroku deploy notification
jasonm authored
73 3. Configure your notification settings (important!)
74 ---------------------------------------------------
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
75
76 Once you have included and configured the notifier in your application,
77 you will want to configure your notification settings.
78
f71c71f @jasonm Add Heroku deploy notification
jasonm authored
79 This is important - without setting your email address, you won't receive notification emails.
80
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
81 Airbrake can deliver exception notifications to your email inbox. To configure these delivery settings:
fca47e9 @jasonm Adding Heroku notifier readme
jasonm authored
82
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
83 1. Visit your applications resources page, like [ http://api.heroku.com/myapps/my-great-app/resources ](http://api.heroku.com/myapps/my-great-app/resources).
84 2. Click the name of your Airbrake addon. (It may still be called Hoptoad.)
85 3. Click "Settings" to configure the Hoptoad Add-on.
f71c71f @jasonm Add Heroku deploy notification
jasonm authored
86
87 4. Optionally: Set up deploy notification
88 -----------------------------------------
89
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
90 If your Airbrake plan supports deploy notification, set it up for your Heroku application like this:
f71c71f @jasonm Add Heroku deploy notification
jasonm authored
91
7446561 @samoli Update hoptoad=>aibrake in rake task example
samoli authored
92 rake airbrake:heroku:add_deploy_notification
f71c71f @jasonm Add Heroku deploy notification
jasonm authored
93
1e90b1a @eostrom Updated Heroku README to use Airbrake's new name.
eostrom authored
94 This will install a Heroku [HTTP Deploy Hook](http://docs.heroku.com/deploy-hooks) to notify Airbrake of the deploy.
Something went wrong with that request. Please try again.