rake タスクがローカル マシンで実行されているが、本番環境では実行されていないという奇妙な問題が発生しています。PRODUCTIONで同じことをしようとすると、次のエラーが発生します
rake が中止されました!初期化されていない定数 User::UserGroup
トレースを実行すると、次の出力が得られました
$ RAILS_ENV=Production Bundle exec rake billing:invoices --trace
** Invoke billing:invoices (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute billing:invoices
Building invoices
rake aborted!
uninitialized constant User::UserGroup
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/base.rb:1205:in `compute_type'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/reflection.rb:162:in `klass'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/associations.rb:2107:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/associations.rb:1984:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/associations.rb:1984:in `build_join_association'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/associations.rb:1948:in `build'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/associations.rb:1956:in `block in build'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/associations.rb:1955:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/associations.rb:1955:in `build'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/associations.rb:1852:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/relation/query_methods.rb:246:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/relation/query_methods.rb:246:in `build_joins'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/relation/query_methods.rb:176:in `build_arel'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/relation/query_methods.rb:149:in `arel'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/relation/batches.rb:51:in `find_in_batches'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.0.11/lib/active_record/relation/batches.rb:20:in `find_each'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p327/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p327/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p327/bin/rake:23:in `<main>'
Tasks: TOP => billing:invoices
奇妙な部分は、ローカル マシンですべて正常に動作していることです。助言がありますか ?