diff --git a/.rvmrc b/.rvmrc
index 07ee9c5e0437aed04ed10ba7b259ec265c359bac..fb7a8f2f0c9a8fd74e813fbbc96e4a3cdfe5f721 100644
--- a/.rvmrc
+++ b/.rvmrc
@@ -7,4 +7,4 @@ fi
 
 if [ "$(gem --version)" != "1.8.12" ]; then
   rvm rubygems 1.8.12
-fi
\ No newline at end of file
+fi
diff --git a/config/ci/before-travis.sh b/config/ci/before-travis.sh
index 0c49d3d5b1432fe3c67a6f5b405e1485ac3b8e1b..e8314c4611320e1864a258145c03fe2125d2dac1 100755
--- a/config/ci/before-travis.sh
+++ b/config/ci/before-travis.sh
@@ -1,3 +1,9 @@
+# Ensure known RubyGems version
+if [ "$(gem --version)" != "1.8.12" ]; then
+  echo "RubyGems version is $(gem --version). Changing..."
+  rvm rubygems 1.8.12
+fi
+
 # Install firefox & Xvfb, in preparation for cucumber & jasmine
 #echo "Installing Firefox and Xvfb"
 #sudo aptitude --quiet=2 --without-recommends --assume-yes install firefox xvfb