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!).
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.