0

I am unable to send exception data to Raygun through the Rails App and the Rake Test task on our staging environment. The sending of exception data works through the Rails Console though.

Raygun.rb

Raygun.setup do |config|
  config.api_key = [Key]
  config.filterparameters = Rails.application.config.filterparameters
  config.enable_reporting = !Rails.env.development?
end

Gemfile.lock raygun entry

raygun4ruby (1.1.9)

httparty (~> 0.11)
json
rack

The error that I get when I try the rake test

$ RAILS_ENV=production rake raygun:test

Oh-oh, something went wrong - double check your API key

API Key - [FIltered])
rake aborted!

TypeError: no implicit conversion of HTTParty::Response into String

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/raygun/testable.rb:17:in `rescue in tracktestexception'

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/raygun/testable.rb:8:in `tracktestexception'

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/tasks/raygun.tasks:5:in `block (2 levels) in

Raygun::ItWorksException: Woohoo! Your Raygun<->Ruby connection is set up correctly

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/raygun/testable.rb:9:in `tracktestexception'

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/tasks/raygun.tasks:5:in `block (2 levels) in

Tasks: TOP => raygun:test

(See full trace by running task with --trace)

We are using AWS for our staging environment. It is surprising to me that Rails C works while through the app and rake test it does not.

When done through the Rails Console

irb(main):003:0> class ItWorksException < StandardError; end
=> nil
irb(main):004:0> e = ItWorksException.new("Woohoo! Your Raygun<->Ruby connection is set up correctly")
=> #
irb(main):005:0> response = Raygun.track_exception(e)

[Raygun] Tracking Exception...
=> #
irb(main):006:0> response.success?
=> true
Karl Gjertsen
  • 4,690
  • 8
  • 41
  • 64
Binu
  • 5
  • 2

1 Answers1

1

This may seem a bit odd, but can you try running it in a slightly different order like:

rake RAILS_ENV=production raygun:test