Config.after_initialize doesn't seem to run

At the end of config/development.rb I have:

config.after_initialize do
ExceptionNotifier.exception_recipients = [‘[email protected]’]
FOOBAR = ‘123’ # Just for testing
end

Now, when I run script/console (or the web server) it seems that the
after_inialize block doesn’t run:

Loading development environment.

ExceptionNotifier.exception_recipients
=> nil

FOOBAR
=> NameError: uninitialized constant FOOBAR

I’m on Rails 1.2.5, BTW.

What am I missing?

Thanks,

Brian

Okay so the constant thing seems to be a namespace issue. The following
works:

config.after_initialize do
Kernel.const_set(‘FOOBAR’, ‘123’)
end

FOOBAR
=> ‘123’

However,

config.after_initialize do
ExceptionNotifier.exception_recipients = [‘[email protected]’]
puts “Recipients are #{ExceptionNotifier.exception_recipients}”
end

When I run script\console, I see:

Loading development environment.
Recipients are [email protected]

ExceptionNotifier.exception_recipients
=> nil

Ack. Problem was my fault. I had conflicting code in environment.rb.