Booting up my Ruby social aggregator app
You can see the answer to Implementing plugins in my Ruby social aggregator app to see some general observations on your code style.

The most important thing I have to point out on this code is that your run loop is not a loop, but a recursion. This is especially bad, since it will eventually kill your whole application on a StackOverflow exception (pun?)

You should always use iteration over recursion when the loop is infinite:

def start
  until @@stop
    @@plugin_manager.run

    logger.debug "Aggregation done. Next aggregation in #{setting.aggregate_timer} seconds."

    sleep setting.aggregate_timer
  end
end


Also, you seem to mix instance scope and class scope. You allow for multiple Aggregators, but there is only a single shutdown. Either design your class for multiple uses, in which case state and methods should be of the instance, or that it is a Singleton, for which there are patterns in ruby.

You seem to have a lot of comments in your code. Ruby encourages less comments, and more expressive method names. There is no point in a comment, if it does not add anything to the code itself. This code:

# Initialize aggregator
app = Aggregator.new(true, ARGV)


has no advantage to simply writing

app = Aggregator.new(true, ARGV)


Using static members (@@stop) is also not advisable. If you are writing inside the self scope (inside def self.shutdown) simple members (@stop) are actually in the class scope, being effectively static. To access them from outside this scope, add a getter:

def self.stop
  @stop
end


Which will be accessible by calling Aggregator.stop.

Refactored Aggregator:

class Aggregator
  include Logging
  include Setting

  AGGREGATOR_VERSION = '0.0.1'

  def self.version
    AGGREGATOR_VERSION
  end

  attr_reader :environment, :plugin_manager, :stop

  def initialize(internal_server = false, arguments = [])
    options = ArgumentParser.parse(arguments)

    Logging::environment options.environment
    Logging::quiet = true if options.quiet

    logger.info 'Starting up aggregator now'

    logger.info "Using #{options.environment} environment"
    @environment = options.environment

    DatabaseInitializer.new(options.environment)

    return if options.environment == :test

    if options.console
      ConsoleInitializer.new(options.environment)
    else
      @plugin_manager = PluginManager.new 

      ServerInitializer.new if internal_server

      logger.info "Aggregator is up and running"

      Signal.trap("SIGINT") do
        Thread.current.exit
      end

      start
    end
  end

  def shutdown
    @stop = true
  end

  private

  def start
    until stop
      @plugin_manager.run

      logger.debug "Aggregation done. Next aggregation in #{setting.aggregate_timer} seconds."
      sleep setting.aggregate_timer
    end
  end
end