Read more

Even with bundler your gem order can be significant

Henning Koch
October 01, 2010Software engineer at makandra GmbH

Even when you're using bundler, it might be significant in which order your gems are listed in your Gemfile. This can happen when gems are running around calling require or require_dependency on other gems or application classes when loaded (don't do that!).

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

A known culprit of this is the (otherwise wonderful) resource_controller Show archive.org snapshot gem, which requires ApplicationController when loaded. When your ApplicationController requires later-loaded gems when loaded, Rails will not boot.

Here is an example for an ApplicationController requiring Aegis::Controller from the aegis Show archive.org snapshot gem:

class ApplicationController < ActionController::Base
  include Aegis::Controller
end

In this case aegis must be listed before resource_controller in your Gemfile or Rails will not boot.

Posted by Henning Koch to makandra dev (2010-10-01 13:51)