5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/rails_environment.rb', line 5
def self.bootup(path = ENVIRONMENT_PATH)
require path
rescue Exception => e
puts "Exception: #{e.to_s}"
puts e.backtrace.join("\n")
config = AlertMachine.config
ActionMailer::Base.mail(
:from => config['from'],
:to => config['to'],
:subject => "AlertMachine Failed: Environment could not load."
) do |format|
format.text {
render :text => <<TXT
machine: #{`hostname`}
exception: #{e.to_s}
#{e.caller.join('\n')}
TXT
}
end.deliver
end
|