diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d0e00bced56ca3b91fee1e6bc4d7cdb2c5324a61..7d18e2c08c5d9c9b03bf7d9f943f548e925f1cd1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,26 +1,52 @@
-image: "registry.roqua.nl/roqua/roqua-build-images:ruby-2.3-rails-base-test"
-
 variables:
   RAILS_ENV: "test"
 
-cache:
-  paths:
-    - .gems
-
 before_script:
   - export BUNDLE_PATH=$CI_PROJECT_DIR/.gems
   - bundle --jobs 2 --retry 3
   - bundle exec appraisal
   - bundle --jobs 2 --retry 3
 
-rails_41:
+.ruby_23: &ruby_23
+  image: registry.roqua.nl/roqua/roqua-build-images:ruby-2.3-rails-base-test
+  cache:
+    key: ruby_23
+    paths:
+      - .gems
+
+.ruby_24: &ruby_24
+  image: registry.roqua.nl/roqua/roqua-build-images:ruby-2.4-rails-base-test
+  cache:
+    key: ruby_24
+    paths:
+      - .gems
+
+rails_41_ruby_23:
+  <<: *ruby_23
   script:
     - bundle exec appraisal rails41 bundle exec rspec
 
-rails_42:
+rails_42_ruby_23:
+  <<: *ruby_23
   script:
     - bundle exec appraisal rails42 bundle exec rspec
 
-rails_50:
+rails_50_ruby_23:
+  <<: *ruby_23
   script:
     - bundle exec appraisal rails50 bundle exec rspec
+
+rails_50_ruby_24:
+  <<: *ruby_24
+  script:
+    - bundle exec appraisal rails50 bundle exec rspec
+
+rails_51_ruby_23:
+  <<: *ruby_23
+  script:
+    - bundle exec appraisal rails51 bundle exec rspec
+
+rails_51_ruby_24:
+  <<: *ruby_24
+  script:
+    - bundle exec appraisal rails51 bundle exec rspec
diff --git a/Appraisals b/Appraisals
index ea9932f39bac369d23e59029239d874413064ff5..ccca3a04df2e394b7aebfc3b8c0203cca799620e 100644
--- a/Appraisals
+++ b/Appraisals
@@ -9,3 +9,7 @@ end
 appraise "rails50" do
   gem "activesupport", "5.0"
 end
+
+appraise "rails51" do
+  gem "activesupport", "5.1"
+end
diff --git a/gemfiles/rails41.gemfile b/gemfiles/rails41.gemfile
index ae5cfb9662a497318cef389f051c9d5ffd76de13..dfe8d29621c49ce376e020001909d49ae991d8f0 100644
--- a/gemfiles/rails41.gemfile
+++ b/gemfiles/rails41.gemfile
@@ -3,11 +3,13 @@
 source "https://rubygems.org"
 
 gem "appraisal"
+gem "roqua_styleguide", :git => "https://gitlab.roqua.nl/roqua/styleguide.git"
 gem "activesupport", "4.1"
 
 group :test do
   gem "actionpack", ">= 4.0"
   gem "active_interaction", "~> 3.0"
+  gem "appsignal"
   gem "combustion", "~> 0.5.2"
   gem "guard-rspec", "~> 4.2.6"
   gem "responders"
diff --git a/gemfiles/rails42.gemfile b/gemfiles/rails42.gemfile
index 0474829e9efdc3a555a5ad2cb743405c0612ac25..b010e367d25479efbbb95de847fab249fdec3046 100644
--- a/gemfiles/rails42.gemfile
+++ b/gemfiles/rails42.gemfile
@@ -3,11 +3,13 @@
 source "https://rubygems.org"
 
 gem "appraisal"
+gem "roqua_styleguide", :git => "https://gitlab.roqua.nl/roqua/styleguide.git"
 gem "activesupport", "4.2"
 
 group :test do
   gem "actionpack", ">= 4.0"
   gem "active_interaction", "~> 3.0"
+  gem "appsignal"
   gem "combustion", "~> 0.5.2"
   gem "guard-rspec", "~> 4.2.6"
   gem "responders"
diff --git a/gemfiles/rails50.gemfile b/gemfiles/rails50.gemfile
index 60cb8ac8e5bfa2a314bfb3e357aa968d26a2bdc5..c8d09da4d4c82b7b458b441f2e28a7a2a5e0c287 100644
--- a/gemfiles/rails50.gemfile
+++ b/gemfiles/rails50.gemfile
@@ -3,11 +3,13 @@
 source "https://rubygems.org"
 
 gem "appraisal"
+gem "roqua_styleguide", :git => "https://gitlab.roqua.nl/roqua/styleguide.git"
 gem "activesupport", "5.0"
 
 group :test do
   gem "actionpack", ">= 4.0"
   gem "active_interaction", "~> 3.0"
+  gem "appsignal"
   gem "combustion", "~> 0.5.2"
   gem "guard-rspec", "~> 4.2.6"
   gem "responders"
diff --git a/gemfiles/rails51.gemfile b/gemfiles/rails51.gemfile
new file mode 100644
index 0000000000000000000000000000000000000000..c4e6b8afdf5807cf9664df43bdbff737a6c4751c
--- /dev/null
+++ b/gemfiles/rails51.gemfile
@@ -0,0 +1,20 @@
+# This file was generated by Appraisal
+
+source "https://rubygems.org"
+
+gem "appraisal"
+gem "roqua_styleguide", :git => "https://gitlab.roqua.nl/roqua/styleguide.git"
+gem "activesupport", "5.1"
+
+group :test do
+  gem "actionpack", ">= 4.0"
+  gem "active_interaction", "~> 3.0"
+  gem "appsignal"
+  gem "combustion", "~> 0.5.2"
+  gem "guard-rspec", "~> 4.2.6"
+  gem "responders"
+  gem "rspec-instrumentation-matcher"
+  gem "rspec-rails"
+end
+
+gemspec :path => "../"