If you want to move the gem, you could just have the method check defined?(ExceptionNotifier) instead of Rails.production?