ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
uninitialized constant TimeEntryJournal (Bug #493)
Description
Running db:migrate on v2.0.0RC3, migrating from Redmine 1.2.0.devel.6081.
RAILS_ENV=production rake db:migrate --trace ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == UpdateJournalsForActsAsJournalized: migrating ============================= -- Updating existing Journals... rake aborted! An error has occurred, all later migrations canceled: uninitialized constant TimeEntryJournal /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:469:in `load_missing_constant' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:106:in `const_missing' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/dependencies.rb:118:in `const_missing' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/inflector.rb:364:in `constantize' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/inflector.rb:363:in `each' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/inflector.rb:363:in `constantize' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/core_ext/string/inflections.rb:162:in `constantize' ./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:13:in `up_without_benchmarks' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/base.rb:2236:in `each_with_index' ./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:10:in `each' ./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:10:in `each_with_index' ./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:10:in `up_without_benchmarks' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activesupport-2.3.12/lib/active_support/ordered_hash.rb:115:in `each_pair' ./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:9:in `up_without_benchmarks' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:328:in `say_with_time' /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:328:in `say_with_time' ./db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb:8:in `up_without_benchmarks' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `send' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate' /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:282:in `migrate' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `__send__' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:365:in `migrate' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:491:in `migrate' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `call' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:567:in `ddl_transaction' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:490:in `migrate' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `each' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:477:in `migrate' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:401:in `up' /usr/local/rvm/gems/ruby-1.8.7-head/gems/activerecord-2.3.12/lib/active_record/migration.rb:383:in `migrate' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-2.3.12/lib/tasks/databases.rake:112 /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:205:in `call' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:200:in `each' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain' /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `each' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:62:in `run' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/lib/rake/application.rb:59:in `run' /usr/local/rvm/gems/ruby-1.8.7-head/gems/rake-0.9.2/bin/rake:32 /usr/local/rvm/gems/ruby-1.8.7-head/bin/rake:19:in `load' /usr/local/rvm/gems/ruby-1.8.7-head/bin/rake:19 Tasks: TOP => db:migrate
Associated revisions
[#493] Force loading the classes of activity provider
This will cause the class to run acts_as_journal which will create the
Journal sub-classes and prevent uninitialized constants since the sub-classes
are created on the fly.
History
Updated by Tom Rochette at 2011-06-29 04:37 am
I could get the thing running by adding
require File.expand_path('../../../app/models/time_entry.rb', __FILE__)
to /db/migrate//20100714111652_update_journals_for_acts_as_journalized.rb. Probably not the clean way to do it though.
Updated by Eric Davis at 2011-07-01 04:38 pm
That's odd that the class wasn't loaded. Let me see if I can reproduce it.
- Assignee set to Eric Davis
Updated by Eric Davis at 2011-07-01 10:31 pm
I forced loading all of the activity classes in 2bb42e9. This will then cause acts_as_journalized to create all of the Journal classes and stop this error.
Thanks for reporting the bug and researching the root cause.
- Status changed from Open to Closed