Configuring Bugflux in existing Rails Project
Bugflux comes with a strong support for Rack based applications in general. To integrate Bugflux into an existing Rails application:
Step 1: Install the
Add the gem appflux-ruby to your Gemfile:
gem 'appflux_ruby', github: 'appflux/appflux-ruby'
Step 2: Bundle install.
cd into your project root directory and run from terminal:
Step 3: Generate the appflux configuration file.
appflux-ruby gem comes with a generator. This generates a file in
Once the bundle is run from Step 2, run the generator:
bundle exec rails generate appflux_ruby:install
Step 4: Add your API token.
Once you have generated the above file, go ahead and open it in text editor of your choice.
config.app_id = '< Your Appflux API token here >'
Your final cofiguration file should look something like:
AppfluxRuby::Bugflux.configure do |config| config.app_id = 'Gkasjhkahdksak873212masbd' # Replace with your API token. end if defined?(::Delayed) require 'appflux_ruby/delayed/plugin' require 'appflux_ruby/message_builders/delayed_job' Delayed::Worker.plugins << ::AppfluxRuby::Delayed::Plugin end # config/initializers/appflux.rb
After completing the installation, unhandled exceptions in your Rails app will be automatically reported to your Bugflux dashboard.
Exceptions in Sidekiq, Delayed Job and Rake will also be automatically reported.