# Rake abort 'const\_missing' occurs if I have DATE\_FORMATS set in environment.rb?

**URL:** <https://www.ruby-forum.com/t/rake-abort-const-missing-occurs-if-i-have-date-formats-set-in-environment-rb/135250>\
**Category:** Rails\
**Created:** [April 19, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/rake-abort-const-missing-occurs-if-i-have-date-formats-set-in-environment-rb/135250 "2008-04-19T22:30:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@greg](https://www.ruby-forum.com/u/greg)\
**Post date:** [April 19, 2008, 10:30pm UTC](https://www.ruby-forum.com/t/rake-abort-const-missing-occurs-if-i-have-date-formats-set-in-environment-rb/135250/1 "2008-04-19T22:30:20Z")

</div>

Hi,  
I get the following error when I add a default DATE\_FORMATS to my  
environments.rb file? Any suggestions? The entry works fine, it’s  
just  
when I go to run “rake db:migrate:reset”.

------------addition to environment.rb--------------------------  
ActiveSupport::CoreExtensions::Time::Conversions::DATE\_FORMATS.merge!(  
:default =\> ‘%d/%m/%Y’,  
:date\_time12 =\> “%d/%m/%Y %I:%M%p”,  
:date\_time24 =\> “%d/%m/%Y %H:%M”  
)

------------ error -------------------------------------  
Macintosh:myEquity greg$ rake db:migrate:reset --trace  
(in /Volumes/USBOPEN/myEquity)  
\*\* Invoke db:migrate:reset (first\_time)  
\*\* Invoke db:drop (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
rake aborted!  
uninitialized constant ActiveSupport  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:2237:in  
`const_missing' /Volumes/USBOPEN/myEquity/config/environment.rb:65 <=== POINTS TO THE LINE "ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(" /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:47:in`run’  
/Volumes/USBOPEN/myEquity/config/environment.rb:16  
/opt/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
/opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/tasks/misc.rake:3  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in`execute’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in`execute’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in  
`invoke_with_call_chain' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in`synchronize’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in  
`invoke_with_call_chain' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in`invoke\_prerequisites’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in`send’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in`invoke\_prerequisites’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in  
`invoke_with_call_chain' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in`synchronize’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in  
`invoke_with_call_chain' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:518:in`invoke\_prerequisites’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in`send’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1183:in `each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:515:in`invoke\_prerequisites’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:507:in  
`invoke_with_call_chain' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in`synchronize’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in  
`invoke_with_call_chain' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in`invoke’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in  
`invoke_task' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in`top\_level’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in`top\_level’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in  
`standard_exception_handling' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in`top\_level’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in`standard\_exception\_handling’  
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.1/bin/rake:31 /opt/local/bin/rake:19:in`load’  
/opt/local/bin/rake:19

thanks
