In Rails, you may want your environment to do different things at startup, depending on whether you are running the rake command or not. For example, in my use case, several hundred MB of cache was loaded into memory at application startup. We clearly do not want this to happen in rake teams.
--- --- update The following is a reliable solution and works with the hero.
is_rake = (ENV['RACK_ENV'].blank? || ENV['RAILS_ENV'].blank? || !("#{ENV.inspect}" =~ /worker/i).blank?)
source share