{"action":"created","issue":{"url":"https://api.github.com/repos/getsentry/raven-ruby/issues/325","labels_url":"https://api.github.com/repos/getsentry/raven-ruby/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/getsentry/raven-ruby/issues/325/comments","events_url":"https://api.github.com/repos/getsentry/raven-ruby/issues/325/events","html_url":"https://github.com/getsentry/raven-ruby/issues/325","id":72930149,"number":325,"title":"Sentry does seem to be recording errors when started via Rails runner","user":{"login":"nfm","id":127960,"avatar_url":"https://avatars.githubusercontent.com/u/127960?v=3","gravatar_id":"","url":"https://api.github.com/users/nfm","html_url":"https://github.com/nfm","followers_url":"https://api.github.com/users/nfm/followers","following_url":"https://api.github.com/users/nfm/following{/other_user}","gists_url":"https://api.github.com/users/nfm/gists{/gist_id}","starred_url":"https://api.github.com/users/nfm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfm/subscriptions","organizations_url":"https://api.github.com/users/nfm/orgs","repos_url":"https://api.github.com/users/nfm/repos","events_url":"https://api.github.com/users/nfm/events{/privacy}","received_events_url":"https://api.github.com/users/nfm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/getsentry/raven-ruby/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-04T05:54:39Z","updated_at":"2015-05-04T17:05:15Z","closed_at":null,"body":"It seems like Sentry doesn't record exceptions for some reason when running code via Rails runner. I've put together a minimal example Rails app to reproduce the issue: https://github.com/nfm/raven_rails_runner_bug\r\n\r\nBasically, running any code via Rails runner that causes an exception (eg. `./bin/rails runner '1 / 0'`) isn't then capturing the exception for me. This happens in production, where other kinds of exceptions are being recorded correctly (from the webserver, but also from rake tasks and delayed jobs). It also happens in development if I configure Raven's environments to include development.\r\n\r\nThe example repo should be pretty straightforward but if not let me know, I'm happy to clarify what's going wrong however I can. Cheers :)"},"comment":{"url":"https://api.github.com/repos/getsentry/raven-ruby/issues/comments/98780556","html_url":"https://github.com/getsentry/raven-ruby/issues/325#issuecomment-98780556","issue_url":"https://api.github.com/repos/getsentry/raven-ruby/issues/325","id":98780556,"user":{"login":"nateberkopec","id":845662,"avatar_url":"https://avatars.githubusercontent.com/u/845662?v=3","gravatar_id":"","url":"https://api.github.com/users/nateberkopec","html_url":"https://github.com/nateberkopec","followers_url":"https://api.github.com/users/nateberkopec/followers","following_url":"https://api.github.com/users/nateberkopec/following{/other_user}","gists_url":"https://api.github.com/users/nateberkopec/gists{/gist_id}","starred_url":"https://api.github.com/users/nateberkopec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateberkopec/subscriptions","organizations_url":"https://api.github.com/users/nateberkopec/orgs","repos_url":"https://api.github.com/users/nateberkopec/repos","events_url":"https://api.github.com/users/nateberkopec/events{/privacy}","received_events_url":"https://api.github.com/users/nateberkopec/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T17:05:15Z","updated_at":"2015-05-04T17:05:15Z","body":"Thanks for the reproducing case, I'll take a look. "}}