# File src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails.rb, line 88
    def initialize!
      return false if !should_initialize?
      return true if initialized?

      begin
        require_lib('initialize')
        require_lib('active_record_subscriber')
        require_lib('exception_logger')
        if defined?(ActionView)
          require_lib('action_view_subscriber')
        end
        if defined?(ActiveSupport::Cache::Store)
          require_lib('active_support_cache_subscriber')
        end
        if defined?(ActionController::Base)
          require_lib('action_controller_extension')
        end
        if defined?(ActiveSupport::Benchmarkable)
          require_lib('active_support_benchmarkable_extension')
        end
      rescue => e
        if UnionStationHooks.config[:initialize_from_check]
          # The union_station_hooks_core gem already reported the error
          # to Union Station.
          STDERR.puts(' *** WARNING: an error occurred while initializing ' \
            'the Union Station Rails hooks. This is because you did not ' \
            'initialize the Union Station hooks from an initializer file. ' \
            'Please create an initializer file ' \
            '`config/initializers/union_station.rb` in which you call ' \
            "this:\n\n" \
            "  if defined?(UnionStationHooks)\n" \
            "    UnionStationHooks.initialize!\n" \
            "  end\n\n" \
            "The error is as follows:\n" \
            "#{e} (#{e.class})\n    " +
            e.backtrace.join("\n    "))
        else
          raise e
        end
      end

      @@initialized = true

      true
    end