2015年6月18日 星期四

Errbit


http://morizyun.github.io/blog/errbit-heroku-rails-error-ruby/

https://github.com/errbit/errbit/blob/master/docs/deployment/heroku.md

Download the source of Errbit locally.


One
git clone http://github.com/errbit/errbit.git

Run Bundle install Following.


One
bundle install

db / seeds.rb Fixed login settings.


1 
2
admin_email  =  "ie: xxx@example.com" 
Admin_pass   =  'password'
One
heroku create xxxx

Then do the Enabling and various settings of the add-on.


1 
2 
3 
4 
5 
6 
7 
8
 heroku addons: create Mongolab: sandbox
 heroku addons: create Sendgrid: Starter
 heroku config: create heroku = truebundle EXEC rake secret heroku config: create SECRET_TOKEN = "$ (bundle EXEC rake secret)" 
replaced with the host name that has been created by the # heroku create
 heroku config: set ERRBIT_HOST = Xxxx.herokuapp.com
 # error mail From (Recommended is given to the distribution and easy addy)
 heroku config: set ERRBIT_EMAIL_FROM = example@example.com

When you have finished setting screen, then push to heroku.


1 
2
git add. -A && git commit -m 'first commit'
 git push heroku Master

In addition, it allows you to load the seed file (initial setting data of the DB).


One
heroku run bundle exec rake db:seed RAILS_ENV=production

Add the index to mongo DB.


One
heroku run bundle exec rake db:mongoid:create_indexes RAILS_ENV=production

after that when you run the following command, you will see the page of errbit in your browser.


One
heroku open


http://blog.8thcolor.com/en/2014/02/get-notified-of-your-rails-app-exceptions-with-errbit/

IN RAILS APP

gem 'airbrake'

create file config / initializers / errbit.Rb


copy paste the the info you got in Errbit > Apps

something likes

Airbrake.configure do |config|
 config.api_key = ENV['ERRBIT_API_KEY']
 config.host    = ENV['ERRBIT_HOST']
 config.port    = 80
 config.secure  = config.port == 443
 config.environment_name = Rails.env.production? ? `hostname` : Rails.env
end



run bundle install after setting down above.

then,
rake airbrake:test

adding
ERRBIT_API_KEY ERRBIT_HOST to heroku



heroku config:set ERRBIT_HOST= 
heroku config:set ERRBIT_API_KEY=


heroku run bundle exec rake airbrake:test





















沒有留言:

張貼留言