---
title: Add zeitwerk:check rake task to you CI system
author: Daniel Schoppmann
tags: Rails
published_at: '2024-02-08T18:38:00+01:00'
updated_at: '2024-07-22T11:06:24+02:00'
canonical_url: https://www.dotruby.com/articles/add-zeitwerk-check-rake-task-to-you-ci-system
---

# Add zeitwerk:check rake task to you CI system

Zeitwerk is Rails powerful code loader, handling all autoloading of ruby files with ease. While it requires specific filenames for classes, potential issues can be preemptively caught using the easy-to-use `zeitwerk:check` rake task, ensuring your Rails application boots properly in production.

[Zeitwerk](https://github.com/fxn/zeitwerk) is the internal code loader for Rails. Rails delegates all autoloading of ruby files to Zeitwerk, which is itself super powerful and highly customizable. By default, Zeitwerk expects your ruby files to have specific filenames, so a class  like `class VATChecker` and a corresponding `vat_checker.rb` file won't work. While there are easy ways around this, we have sometimes run into this error and there have been times where the production application did not start because of a code loading error that slipped through in dev mode. 

Fortunately, there is an easy-to-use `zeitwerk:check` rake task that you can use to ensure that your Rails application will boot properly in production. This is especially useful if you have renamed some classes with a structure that Zeitwerk does not expect and your test system does not (yet) catch the new files. Or you have an old codebase and want to upgrade to a newer version of Rails. Best to add it to your CI system of choice so you can catch errors like this up front.

```bash
bundle exec rails zeitwerk:check
```
