2

プロジェクトにRails3.2.3とActiveAdminを使用しています。データベースをレーキしようとすると、「クラスBillingCycleのスーパークラスの不一致」と表示され、クラスの名前を他のものに変更すると同じエラーが発生します。Active Adminのもの(初期化子、管理フォルダー、ルート)を取り出した場合は実行できましたが、db:migrateごとに実行する必要のないソリューションが必要です。完全なトレースは次のとおりです。

    superclass mismatch for class BillingCycle
/Users/ashley/public_afme/db/migrate/20120711022055_billing_cycle.rb:   1:in `<top (required)>'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/   active_support/dependencies.rb:251:in `require'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:537:in `load_migration'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:533:in `migration'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:528:in `migrate'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:775:in `call'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:775:in `block in ddl_transaction'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:208:in `transaction'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:775:in `ddl_transaction'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:719:in `block in migrate'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:700:in `each'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:700:in `migrate'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:570:in `up'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/migration.rb:551:in `migrate'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/railties/databases.rake:153:in `block (2 levels) in <top (required)>'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/ashley/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/ashley/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'

これを修正するにはどうすればよいですか?

4

1 に答える 1

2

移行に BillingCycle という名前を付けた可能性があると思います。BillingCycle の移行ファイルの先頭にこれがないことを確認してください: class BillingCycle < ActiveRecord::Migration

その場合は、そのクラスの名前を別の名前に変更します (「AddingBillingCycle」など)。

于 2012-08-07T15:54:47.267 に答える