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 online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
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)