Changing Date Format - it works, but then I get a "uninitialized constant ActiveSupport"

Hi,

When I change date formats via the following entry in environments.rb
it works fine. Web pages reflect the new date format.
“ActiveSupport::CoreExtensions::date::Conversions::DATE_FORMATS[:default]”

The issue is when I run things like “./script/console”, or
"./script/spec " I get a “NameError: uninitialized constant
ActiveSupport” issue. Any ideas how to solve this?


Macintosh-2:myequity greg$ ./script/console
Loading development environment (Rails 2.1.1)
/Users/greg/source/myequity/config/environment.rb:69:NameError:
uninitialized constant ActiveSupport
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/dispatcher.rb:93:NoMethodError:
undefined method cattr_accessor' for ActionController:: Dispatcher:Class /opt/local/lib/ruby/gems/1.8/gems/rails-2.1.1/lib/console_with_helpers.rb:19:NoMethodError: undefined methodrequire_dependency’ for main:Object

Macintosh-2:myequity greg$ ./script/spec spec/models/transaction_spec.rb
/Users/greg/source/myequity/config/environment.rb:69: uninitialized
constant ActiveSupport (NameError)
from
/opt/local/lib/ruby/gems/1.8/gems/rails-2.1.1/lib/initializer.rb:95:in
run' from /Users/greg/source/myequity/config/environment.rb:20 from /Users/greg/source/myequity/spec/spec_helper.rb:4:inrequire’
from /Users/greg/source/myequity/spec/spec_helper.rb:4
from ./spec/models/transaction_spec.rb:1:in require' from ./spec/models/transaction_spec.rb:1 from /Users/greg/source/myequity/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:14:inload’
from
/Users/greg/source/myequity/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:14:in
load_files' from /Users/greg/source/myequity/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:13:ineach’
from
/Users/greg/source/myequity/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:13:in
load_files' from /Users/greg/source/myequity/vendor/plugins/rspec/lib/spec/runner/options.rb:98:inrun_examples’
from
/Users/greg/source/myequity/vendor/plugins/rspec/lib/spec/runner/command_line.rb:19:in
`run’
from ./script/spec:4
Macintosh-2:myequity greg$

thanks in advance

oh…I see there was an answer to this in a previous forum post that
solves this:

looks like you’ve put the ActiveSupport line inside the
Rails::Initializer.run block.
you need to put it at the end of your environment.rb file, else
ActiveSupport hasn’t yet been loaded… hence the exception it raises.

On Mon, Sep 8, 2008 at 11:17 AM, Greg H.