diff --git a/tests/integration/modules/gem.py b/tests/integration/modules/gem.py
index <HASH>..<HASH> 100644
--- a/tests/integration/modules/gem.py
+++ b/tests/integration/modules/gem.py
@@ -27,7 +27,10 @@ def check_status():
     '''
     Check the status of the rubygems source
     '''
-    ret = salt.utils.http.query('https://rubygems.org', status=True)
+    try:
+        ret = salt.utils.http.query('https://rubygems.org', status=True)
+    except Exception:
+        return False
     return ret['status'] == 200
Skip Ruby tests on exception in pre-req check