Listen errors when building Rails 5 app

When running tests on a Rails 5 beta app, I get the following error occasionally. This error is intermittent, so it only sometimes fails the build. When it does, re-running the build usually works (if not on the first re-build, then eventually). Rails 5 depends on the Listen gem, so I’m assuming that is the culprit. The error points to this wiki article for a fix.

1 Like

For the curious, here is the Rails PR that added the Listen dependency.

I’m having the same issue. Have you been able to find a way to implement the suggested fix on CircleCI?

I have not. I was hoping for an official reply from CircleCI to let me know the best way to address this.

Thank you for reporting this and sorry for the slow reply. We’re aware of the issue that inotify watches limit needs to be increased.

We’ll update here as soon as a fix is available.

Hi, @lleger

inotify is a kernel parameter and unprivileged container (containers that run builds) cannot modify the parameter. We may be able to increase the parameter on LXC host but that requires more work and we normally don’t change LXC host unless there is decent amount of demands from users/customers. Unfortunately, we cannot fix the issue at this moment.

Hi, @kimh. Totally understand that it may not be an easy fix. Since this is a new standard in Rails 5, and I would assume a few Rails apps are built on Circle, I can imagine this will become a bigger issue. In the meantime, can you provide a workaround? The intermittent failures are a real drag on our productivity. Thanks!

1 Like

@lleger I realized the Listen gem is really only used in the development environment.

Adding the following fixed my issues:

dependencies:
  bundler:
    without: [development]